Closed (duplicate)
Project:
Drupal core
Version:
x.y.z
Component:
node.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2005 at 21:39 UTC
Updated:
11 Sep 2005 at 15:21 UTC
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
Comment #1
m3avrck commentedFixed in this patch: http://drupal.org/node/30930