summaryrefslogtreecommitdiff
path: root/includes/menu.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-02 17:34:24 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-02 17:34:24 +0000
commit44aefb0a4e7e7794fc74f0fe48b10fae1b546699 (patch)
treeabdcd64463fd7c6eda4a5c9a4e09cead358aed46 /includes/menu.inc
parent35caf24c35f0c4a3925217d9c3be5596760cd7eb (diff)
downloadbrdo-44aefb0a4e7e7794fc74f0fe48b10fae1b546699.tar.gz
brdo-44aefb0a4e7e7794fc74f0fe48b10fae1b546699.tar.bz2
#979958 by das-peter, Damien Tournoud: Fixed regression in load_functions detection for menu items
Diffstat (limited to 'includes/menu.inc')
-rw-r--r--includes/menu.inc17
1 files changed, 14 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 382f02cd4..0b8f59436 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -3518,9 +3518,20 @@ function _menu_router_build($callbacks) {
$item['theme arguments'] = $parent['theme arguments'];
}
}
- // Same for load arguments, if the parent path defines any.
- if (!isset($item['load arguments']) && !empty($parent['load arguments'])) {
- $item['_load_functions'] = $parent['_load_functions'];
+ // Same for load arguments: if a loader doesn't have any explict
+ // arguments, try to find arguments in the parent.
+ if (!isset($item['load arguments'])) {
+ foreach ($item['_load_functions'] as $k => $function) {
+ // This loader doesn't have any explict arguments...
+ if (!is_array($function)) {
+ // ... check the parent for a loader at the same position
+ // using the same function name and defining arguments...
+ if (isset($parent['_load_functions'][$k]) && is_array($parent['_load_functions'][$k]) && key($parent['_load_functions'][$k]) == $function) {
+ // ... and inherit the arguments on the child.
+ $item['_load_functions'][$k] = array($function => reset($parent['_load_functions'][$k]));
+ }
+ }
+ }
}
}
}