Issue #3227370 by pfrenssen: Toolbar menu theme override omits the 'menu_name' variable
(cherry picked from commit 117db6f91b
)
merge-requests/561/head
parent
b5cfa7cfa4
commit
7a5d5cdd09
|
@ -48,3 +48,14 @@ function toolbar_test_toolbar() {
|
|||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK().
|
||||
*/
|
||||
function toolbar_test_preprocess_menu(&$variables) {
|
||||
// All the standard hook_theme variables should be populated when the
|
||||
// Toolbar module is rendering a menu.
|
||||
foreach (['menu_name', 'items', 'attributes'] as $variable) {
|
||||
$variables[$variable];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ function toolbar_theme($existing, $type, $theme, $path) {
|
|||
];
|
||||
$items['menu__toolbar'] = [
|
||||
'base hook' => 'menu',
|
||||
'variables' => ['items' => [], 'attributes' => []],
|
||||
'variables' => ['menu_name' => NULL, 'items' => [], 'attributes' => []],
|
||||
];
|
||||
|
||||
return $items;
|
||||
|
|
Loading…
Reference in New Issue