As I'm going through Drupal cleaning up undefined variables, I've stumbled upon this function:

function node_access_view_all_nodes() {
  static $access;

  if (!isset($access)) {
    $sql = 'SELECT COUNT(*) FROM {node_access} WHERE nid = 0 AND CONCAT(realm, gid) IN (';
    $grants = array();
    foreach (node_access_grants('view') as $realm => $gids) {
      foreach ($gids as $gid) {
        $grants[] = "'". $realm . $gid ."'";
      }
    }
    $sql .= implode(',', $grants) .') AND grant_view = 1';
    $result = db_query($sql, $node->nid);
    $access = db_result($result);
  }

  return $access;
}

$node->nid is undefined here.

Seems like this could have implications on node access, needs to be looked into.

Comments

m3avrck’s picture

Status: Active » Closed (duplicate)

Fixed in this patch: http://drupal.org/node/30930