Unverified Commit 7a5d5cdd authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3227370 by pfrenssen: Toolbar menu theme override omits the 'menu_name' variable

(cherry picked from commit 117db6f9)
parent b5cfa7cf
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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];
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -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;