New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entities): update attribute when assuming container_guid value #9205

Closed
wants to merge 1 commit into
base: 2.0
from

Conversation

Projects
None yet
2 participants
@hypeJunction
Contributor

hypeJunction commented Dec 7, 2015

ElggEntity::create() assumes container_guid equals owner_guid when container_guid is
set to 0, but does so in introduced variables without updating the attribute. This
results in discrepancies between ElggEntity::getContainerGUID() and the value
written to the database

Fixes #8981

fix(entities): update attribute when assuming container_guid value
ElggEntity::create() assumes container_guid equals owner_guid when container_guid is
set to 0, but does so in introduced variables without updating the attribute. This
results in discrepancies between ElggEntity::getContainerGUID() and the value
written to the database

Fixes #8981
@@ -1516,6 +1516,7 @@ protected function create() {
$container_guid = $this->attributes['container_guid'];
if ($container_guid == 0) {
$this->attributes['container_guid'] = $owner_guid;

This comment has been minimized.

@mrclay

mrclay Dec 8, 2015

Member

Good catch. Testing this would be easy, no?

@mrclay

mrclay Dec 8, 2015

Member

Good catch. Testing this would be easy, no?

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Dec 8, 2015

Member

Did you verify this problem isn't in 1.12?

Member

mrclay commented Dec 8, 2015

Did you verify this problem isn't in 1.12?

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Dec 8, 2015

Member

Yeah, should go in 1.12.

Member

mrclay commented Dec 8, 2015

Yeah, should go in 1.12.

@mrclay mrclay closed this Dec 8, 2015

@hypeJunction hypeJunction deleted the hypeJunction:entity-create branch Dec 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment