Commit 81432429 authored by davereid's avatar davereid Committed by Dave Reid

Issue #2288325 by Daemon_Byte, Dave Reid: Fixed menu_block_get_all_menus() is...

Issue #2288325 by Daemon_Byte, Dave Reid: Fixed menu_block_get_all_menus() is not cached by language.
parent 79b691b0
......@@ -184,7 +184,8 @@ function menu_block_get_all_menus() {
$all_menus = &drupal_static(__FUNCTION__);
if (!$all_menus) {
if ($cached = cache_get('menu_block_menus', 'cache_menu')) {
$cid = 'menu_block_menus:' . $GLOBALS['language']->language;
if ($cached = cache_get($cid, 'cache_menu')) {
$all_menus = $cached->data;
}
else {
......@@ -192,12 +193,13 @@ function menu_block_get_all_menus() {
$all_menus = menu_get_menus();
// Retrieve all the menu names provided by hook_menu_block_get_menus().
$all_menus = array_merge($all_menus, module_invoke_all('menu_block_get_menus'));
// Add an option to use the menu for the active menu item.
$all_menus[MENU_TREE__CURRENT_PAGE_MENU] = '<' . t('the menu selected by the page') . '>';
asort($all_menus);
cache_set('menu_block_menus', $all_menus, 'cache_menu');
// Add an option to use the menu for the active menu item.
$all_menus = array(MENU_TREE__CURRENT_PAGE_MENU => '<' . t('the menu selected by the page') . '>') + $all_menus;
cache_set($cid, $all_menus, 'cache_menu');
}
}
return $all_menus;
}
......
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