Skip to content
Snippets Groups Projects
Commit df710a89 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2271025 by Wim Leers: Don't let menu_navigation_links() set the active...

Issue #2271025 by Wim Leers: Don't let menu_navigation_links() set the active class, the drupal.active-links library does that for us (plus, it's setting it incorrectly).
parent 52a11d6a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -464,13 +464,6 @@ function menu_navigation_links($menu_name, $level = 0) { ...@@ -464,13 +464,6 @@ function menu_navigation_links($menu_name, $level = 0) {
$class = ' active-trail'; $class = ' active-trail';
$l['attributes']['class'][] = 'active-trail'; $l['attributes']['class'][] = 'active-trail';
} }
// Normally, l() compares the href of every link with the current path and
// sets the active class accordingly. But local tasks do not appear in
// menu trees, so if the current path is a local task, and this link is
// its tab root, then we have to set the class manually.
if ($item['link']['href'] != current_path()) {
$l['attributes']['class'][] = 'active';
}
// Keyed with the unique mlid to generate classes in links.html.twig. // Keyed with the unique mlid to generate classes in links.html.twig.
$links['menu-' . $item['link']['mlid'] . $class] = $l; $links['menu-' . $item['link']['mlid'] . $class] = $l;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment