diff -u b/modules/node/node.module b/modules/node/node.module --- b/modules/node/node.module +++ b/modules/node/node.module @@ -3195,11 +3195,7 @@ * arrays of grants for those realms. */ function node_access_grants($op, $account = NULL) { - $grants = &drupal_static(__FUNCTION__); - - if (!isset($grants)) { - $grants = array(); - } + $grants = &drupal_static(__FUNCTION__, array()); if (!isset($account)) { $account = $GLOBALS['user']; diff -u b/modules/node/node.test b/modules/node/node.test --- b/modules/node/node.test +++ b/modules/node/node.test @@ -2261,7 +2261,6 @@ // Test that the noAccessUser still doesn't have the 'view' // privilege after adding the node_access record. drupal_static_reset('node_access_view_all_nodes'); - drupal_static_reset('node_access_grants'); try { $query = db_select('node', 'mytab') ->fields('mytab'); @@ -2284,7 +2283,6 @@ $this->drupalLogin($this->noAccessUser2); variable_set('node_test_node_access_all_uid', $this->noAccessUser->uid); drupal_static_reset('node_access_view_all_nodes'); - drupal_static_reset('node_access_grants'); try { $query = db_select('node', 'mytab') ->fields('mytab'); @@ -2333,6 +2331,7 @@ // Test that the noAccessUser still doesn't have the 'view' // privilege after adding the node_access record. drupal_static_reset('node_access_view_all_nodes'); + drupal_static_reset('node_access_grants'); try { $query = db_select('node', 'mytab') ->fields('mytab'); @@ -2355,6 +2354,7 @@ $this->drupalLogin($this->noAccessUser2); variable_set('node_test_node_access_all_uid', $this->noAccessUser->uid); drupal_static_reset('node_access_view_all_nodes'); + drupal_static_reset('node_access_grants'); try { $query = db_select('node', 'mytab') ->fields('mytab');