Skip to content

Commit

Permalink
Use core method for checking if node is published
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab authored and gheydon committed Oct 26, 2020
1 parent 0264f7b commit b11f726
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 @@ -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 [];
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b11f726

Please sign in to comment.