diff --git a/core/lib/Drupal/Core/Entity/EntityBCDecorator.php b/core/lib/Drupal/Core/Entity/EntityBCDecorator.php index e194001..7bee5d3 100644 --- a/core/lib/Drupal/Core/Entity/EntityBCDecorator.php +++ b/core/lib/Drupal/Core/Entity/EntityBCDecorator.php @@ -182,7 +182,20 @@ public function __set($name, $value) { */ public function __isset($name) { $value = $this->__get($name); - return isset($value); + // Horrible code but necessary because non existing properties are + // initialized with the value NULL. + if (($isset = isset($value)) && is_array($value)) { + $isset = FALSE; + foreach ($value as $langcode => $data) { + foreach ($data as $delta => $value) { + if (!is_null($value)) { + $isset = TRUE; + break(2); + } + } + } + } + return $isset; } /** diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 1e42dcd..7884886 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2643,7 +2643,7 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) { } // Check if authors can view their own unpublished nodes. - if ($op == 'view' && !$node->get('status', $langcode) && user_access('view own unpublished content', $account) && $account->uid == $node->get('uid', $langcode) && $account->uid != 0) { + if ($op == 'view' && empty($node->get('status', $langcode)->value) && user_access('view own unpublished content', $account) && $account->uid == $node->get('uid', $langcode)->value && $account->uid != 0) { $rights[$account->uid][$cid][$langcode][$op] = TRUE; return TRUE; } @@ -2680,7 +2680,7 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) { $rights[$account->uid][$cid][$langcode][$op] = $result; return $result; } - elseif (is_object($node) && $op == 'view' && $node->get('status', $langcode)) { + elseif (is_object($node) && $op == 'view' && !empty($node->get('status', $langcode)->value)) { // If no modules implement hook_node_grants(), the default behavior is to // allow all users to view published nodes, so reflect that here. $rights[$account->uid][$cid][$langcode][$op] = TRUE; diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index b4a512a..33f140d 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -1464,7 +1464,7 @@ function taxonomy_node_predelete(EntityInterface $node) { /** * Deletes taxonomy index entries for a given node. * - * @param Drupal\node\Plugin\Core\Entity\Node $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node entity. */ function taxonomy_delete_node_index(EntityInterface $node) {