2c2 < index 8f247cd..822e45d 100644 --- > index 8f247cd..9aa1d0a 100644 14c14,28 < @@ -3434,7 +3434,23 @@ function _node_query_node_access_alter($query, $type) { --- > @@ -3402,6 +3402,13 @@ function _node_query_node_access_alter($query, $type) { > $subquery = db_select('node_access', 'na') > ->fields('na', array('nid')); > > + // Increment the placeholder index on the subquery until it matches the > + // placeholders used by the main query. > + $np = count($query->getArguments()); > + while ($np--) { > + $subquery->nextPlaceholder(); > + } > + > $grant_conditions = db_or(); > // If any grant exists for the specified user, then user has access > // to the node for the specified operation. > @@ -3434,7 +3441,22 @@ function _node_query_node_access_alter($query, $type) { 31,32c45 < + $cond_count = $subquery->nextPlaceholder(); < + while ($cond_count--) { --- > + foreach ($subquery->arguments() as $_a) {