From 09a553da353c78c34ecd695032675da28a40dcfa Mon Sep 17 00:00:00 2001 From: Dan Braghis Date: Mon, 13 Mar 2017 11:07:30 +0000 Subject: [PATCH] Use core method for checking if node is published --- og_access/og_access.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/og_access/og_access.module b/og_access/og_access.module index 0aa1637e1..b1641c9de 100644 --- a/og_access/og_access.module +++ b/og_access/og_access.module @@ -68,7 +68,7 @@ function og_access_node_grants(AccountInterface $account, $op) { * Implements hook_node_access_records(). */ function og_access_node_access_records(NodeInterface $node) { - if (empty($node->status)) { + if (!$node->isPublished()) { // Node is unpublished, so we don't allow every group member to see it. return []; } @@ -181,7 +181,7 @@ function og_access_entity_type_save(EntityInterface $entity) { $definition = \Drupal::entityTypeManager()->getDefinition($entity->getEntityTypeId()); $entity_type_id = $definition->getBundleOf(); - // Add/remove the group itself. + // Add/remove on the group itself. $is_group = Og::isGroup($entity_type_id, $bundle); if ($entity->og_is_group != $is_group) { if ($entity->og_is_group) {