diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-25 19:59:38 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-25 19:59:38 +0000 |
commit | 241e22f5c219dde0b1352f26dbb651c2f564913c (patch) | |
tree | fe0a6935bde5a6b69ef6ddcacb02e7fe29ea91c8 /engine | |
parent | 72de53f6b9cf475e73271bda388f3097adc625e8 (diff) | |
download | elgg-241e22f5c219dde0b1352f26dbb651c2f564913c.tar.gz elgg-241e22f5c219dde0b1352f26dbb651c2f564913c.tar.bz2 |
Emit a warning + debug info when an attempt to register a menu item fails
git-svn-id: http://code.elgg.org/elgg/trunk@8470 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/navigation.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 5e03641a1..1a0aa51a0 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -35,13 +35,15 @@ function elgg_register_menu_item($menu_name, $menu_item) { } if (is_array($menu_item)) { - $menu_item = ElggMenuItem::factory($menu_item); - if (!$menu_item) { + $item = ElggMenuItem::factory($menu_item); + if (!$item) { + elgg_log("Unable to add menu item '{$menu_item['name']}' to '$menu_name' menu", 'WARNING'); + elgg_log(print_r($menu_item, true), 'DEBUG'); return false; } } - $CONFIG->menus[$menu_name][] = $menu_item; + $CONFIG->menus[$menu_name][] = $item; return true; } |