Skip to content

Commit

Permalink
Fix og_access realm (Gizra#1)
Browse files Browse the repository at this point in the history
* Fix og_access realm
* Use entity type instead of bundle type in realm records
  • Loading branch information
svendecabooter authored and gheydon committed Oct 26, 2020
1 parent 9eff741 commit 4ad6906
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions og_access/og_access.module
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function og_access_node_access_records(NodeInterface $node) {
$audience_helper = \Drupal::service('og.group_audience_helper');
foreach ($audience_helper->getAllGroupAudienceFields('node', $node->getType()) as $field_name => $field) {
foreach ($node->get($field_name)->referencedEntities() as $group) {
$list_gids[$group->getType][] = $group->id();
$list_gids[$group->getEntityTypeId()][] = $group->id();

if ($has_private) {
// We already know we have a private group, so we can avoid
Expand All @@ -131,7 +131,7 @@ function og_access_node_access_records(NodeInterface $node) {
$audience_helper = \Drupal::service('og.group_audience_helper');
foreach ($audience_helper->getAllGroupAudienceFields('node', $node->getType()) as $field_name => $field) {
foreach ($node->get($field_name)->referencedEntities() as $group) {
$list_gids[$group->getType][] = $group->id();
$list_gids[$group->getEntityTypeId()][] = $group->id();
}
}

Expand Down

0 comments on commit 4ad6906

Please sign in to comment.