Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Drupal, by default does not recognise URL queries when loading menu items. Thus when there are multiple menu items with the same path but different URL queries, Drupal loads first menu item that has the matching path without looking at the query.
This module provides a workaround for that by overriding the menu item and active menu trail for any page that has a menu item and has query parameter set.
No configuration is required, just install and you're off.
Caveats:
May cause a performance hit, only use if you really need this.
Naturally, since each matching menu item has to be loaded and its query inspected, there is a performance hit on each request.
Database and static caches are being leveraged, however the performance hit cannot be completely solved.
If there are multiple menu items with the same base path and query parameters, only the first item is used.
If you land on a page with a query which does not have a menu item but the base path exists in the database, the module will try and use the menu item without a query. E.g.:
If you land on a views page with a filter set in the URL such as "my/views/page?filter=2" which has a menu item, it will be set correctly.