diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 49ad8ae..5a3854f 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -8,7 +8,6 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Language\Language; -use Drupal\Core\Template\Attribute; use Drupal\menu_link\Plugin\Core\Entity\MenuLink; use Drupal\menu_link\MenuLinkStorageController; use Symfony\Component\HttpFoundation\Request; @@ -1627,7 +1626,7 @@ function template_preprocess_menu_link(&$variables) { $variables['sub_menu'] = $element['#below']; $variables['link'] = l($element['#title'], $element['#href'], $element['#localized_options']); - $variables['wrapper_attributes'] = new Attribute($element['#attributes']); + $variables['attributes'] = $element['#attributes']; } /** @@ -1649,10 +1648,9 @@ function template_preprocess_menu_local_task(&$variables) { 'content' => $link['title'], ); - $variables['wrapper_attributes'] = new Attribute(); $variables['active'] = FALSE; if (!empty($variables['element']['#active'])) { - $variables['wrapper_attributes']['class'] = array('active'); + $variables['attributes']['class'] = array('active'); $variables['active'] = TRUE; // If the link does not contain HTML already, check_plain() it now. diff --git a/core/modules/system/templates/menu-link.html.twig b/core/modules/system/templates/menu-link.html.twig index 5035ea2..8415451 100644 --- a/core/modules/system/templates/menu-link.html.twig +++ b/core/modules/system/templates/menu-link.html.twig @@ -4,7 +4,7 @@ * Default theme implementation for a menu link and submenu. * * Available variables: - * - wrapper_attributes: HTML attributes for the wrapper element. + * - attributes: HTML attributes for the wrapper element. * - link: An HTML link element. * - sub_menu: Rendered list item children of the element. * @@ -17,6 +17,6 @@ * @ingroup themeable */ #} -