diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 287c5af..157c445 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -3298,7 +3298,15 @@ function _node_query_node_access_alter($query, $type) { $field = 'entity_id'; } $subquery->where("$nalias.$field = na.nid"); - $query->exists($subquery); + if (empty($tableinfo['join type'])) { + // If we are looking at the main table of the query, apply the + // subquery directly. + $query->exists($subquery); + } else { + // If we are looking at a joined table, add the node access check + // to the join condition. + $tables[$nalias]['condition'] .= ' AND ' . (string)$subquery; + } } }