in_active_trail not set if there are two menu items with the same path in a menu / ignore deactivated menu items

Created on 25 January 2023, almost 2 years ago

As I am currently unsure whether this is a bug or a feature, I have defined this as a feature request for now.

Problem/Motivation

In my main menu there are two menu items that refer to the start page ().
The standard Drupal menu item ("standard.front_page") and a manually created menu item for the front page.

The default Drupal menu item for the start page can only be deactivated (not visible in the menu) and cannot be deleted or edited (e.g. set additional attributes).
This is also the reason why a custom menu item was created for the start page (to edit the "label" or to set an additional attribute).

However, when setting the Active Trail, the "standard.front_page" item (which is disabled) always wins because of the array_reverse(). For this reason, the active_trail is never set for the custom menu item.

Proposed resolution

When setting the Active Trail (getActiveTrailLinks), deactivated menu items should be ignored/filtered during the consideration.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany cbeier

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024