diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 7295856..bca242b 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2669,9 +2669,11 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) { $query = db_select('node_access'); $query->addExpression('1'); $query->condition('grant_' . $op, 1, '>='); + // Check if this grant is given for the node in this language, so we check that grant. $nids = db_and() ->condition('nid', $node->nid) ->condition('langcode', $langcode); + // But if the node is published, we take into account the default for this grant, which is saved with nid = 0. if ($node->status) { $nids = db_or() ->condition($nids) @@ -2988,6 +2990,8 @@ function node_query_node_access_alter(AlterableInterface $query) { $subquery->condition($grant_conditions); } $subquery->condition('na.grant_' . $op, 1, '>='); + // If no langcode is given, add a condition for checking the fallback language. If the language is given, + // just use it as a condition. if ($langcode === FALSE) { $subquery->condition('na.fallback', 1, '='); }