Menu item not active if provided by views configuration

Created on 11 April 2024, 7 months ago
Updated 16 May 2024, 6 months ago

Problem/Motivation

I have a view with a menu entry. The view shows press articles. If the menu item is provided via views configuration then the menu item is not set to active. If I add the menu item manually to the menu with the views path the menu item is set active.

Steps to reproduce

  1. Create node content with path /press/xyz
  2. Create view with menu item (Path /press)

Proposed resolution

Views menu entry should also be flagged as active.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany sense-design Münster

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

Comments & Activities

  • Issue created by @sense-design
  • 🇺🇸United States mlncn Minneapolis, MN, USA

    We are running into the same thing and it feels like a pretty major gap for a module that is supposed to look at paths and not care how the paths are created.

    $trail_url->getRouteName() is views.people.page and $trail_url->getRouteParameters() is view_id: "people", display_id: "page".

    $this->menuLinkManager->loadLinksByRoute(), called in getActiveTrailLink(), claims that the above is not in the main menu, but it is there as a Views-provided menu link as noted by sense-design.

Production build 0.71.5 2024