Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #353 from alesrebec/7.x-2.x
Browse files Browse the repository at this point in the history
Undefined property stdClass::$original in og_entity_update when updating group
  • Loading branch information
alesrebec authored Jun 20, 2018
2 parents 51e15f1 + f00ccb0 commit 81cd92d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions og.module
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,10 @@ function og_entity_update($entity, $entity_type) {
}
}
}
$original_entity = $entity->original;
$original_entity = isset($entity->original) ? $entity->original : NULL;
$property = OG_DEFAULT_ACCESS_FIELD;

if (!empty($entity->{$property}) && $entity->{$property} != $original_entity->{$property}) {
if (!empty($entity->{$property}) && !empty($original_entity->{$property}) && $entity->{$property} != $original_entity->{$property}) {
if (!og_is_group_default_access($entity_type, $entity)) {
// Override default roles.
og_roles_override($entity_type, $bundle, $id);
Expand Down

0 comments on commit 81cd92d

Please sign in to comment.