Commit 6725c814 authored by salvis's avatar salvis

Avoid the assumption that the array returned by hook_node_access_records() has an index 0.

parent 6079963f
......@@ -261,10 +261,10 @@ function devel_node_access_block($op = 'list', $delta = 0) {
// check node_access_acquire_grants()
$grants = _devel_node_access_module_invoke_all('node_access_records', $node);
if (!empty($grants)) {
$top_priority = intval($grants[0]['priority']);
$top_priority = NULL;
foreach ($grants as $grant) {
$priority = intval($grant['priority']);
$top_priority = max($top_priority, $priority);
$top_priority = (isset($top_priority) ? max($top_priority, $priority) : $priority);
$grant['priority'] = (isset($grant['priority']) ? $priority : '– ');
$acquired_grants_nid[$priority][$grant['realm']][$grant['gid']] = $grant + array(
'#title' => ($node->title ? check_plain($node->title) : $node->nid),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment