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

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 committed Mar 13, 2017
1 parent 029f92b commit 09a553d
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 09a553d

Please sign in to comment.