Skip to content

Commit

Permalink
Merge pull request #161 from amitaibu/notice-new-content
Browse files Browse the repository at this point in the history
Prevent notice on create new content
  • Loading branch information
amitaibu authored Sep 4, 2016
2 parents 0402e17 + 64ae357 commit f747885
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/MembershipManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ public function getGroupIds(EntityInterface $entity, $group_type_id = NULL, $gro
continue;
}

$values = $entity->get($field->getName())->getValue();
if (empty($values[0])) {
// Entity doesn't reference any groups.
continue;
}

// Compile a list of group target IDs.
$target_ids = array_map(function ($value) {
return $value['target_id'];
Expand Down

0 comments on commit f747885

Please sign in to comment.