Problem/Motivation
Active trails are not calculated correctly for menu items created with views. This is caused by the the fact that view page routes contain the view_id and display_id parameters, which are not saved in the menu_tree table.
Steps to reproduce
1. Install a site with the olivero theme
2. Create a view page
3. In the view settings, under Page settings > Menu, add Normal menu entry under main menu
4. Visit the view page
5. Inspect the HTML of the menu link. The link does not have any active trail classes (e.g. is-active)
Proposed resolution
Change the way views menu links are saved. They should also store the view_id and display_id parameters.
Comments
Comment #2
stefan.butura commentedPatch attached. Requires a cache rebuild.
Comment #3
larowlanThis is a duplicate of #3359511: [regression] missing menu active trail since Drupal 9.5.9
But your patch seems simpler. Let's discuss over there?
Comment #4
shabana.navas commentedThis patch is a great and simple fix. However, it does not work for Views that have contextual filters.
Comment #5
vurt commentedI can confirm that the patch works as expected. Thank you.