Custom menu items with query string parameters fail to expand

Anonymous (not verified) - October 14, 2004 - 04:38
Project:Drupal
Version:5.7
Component:menu system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

It seems that using menus, when you have an item with subitems under it, the menu fails to expand on click when the associated link (for the parent item) contains ? arguments. An example of what I mean:

I have a link in a menu that goes to flexinode/termstable/4/1, and that works fine (it expands on click to show what's under it.)

When I change it to link to flexinode/termstable/4/1?sort=asc&order=Date or even just flexinode/termstable/4/1?sort=asc, it goes there correctly on click but does not expand!

If these URLs look weird, it's because I'm using flexinode_terms_extension, which was posted here: http://drupal.org/node/11212 .

#1

JonBob - October 14, 2004 - 14:26

The $_GET['q'] variable is used to test for the user's current location. This does not reflect additional query string parameters such as the sort=asc in your example. I agree that it would be nice to allow for query string parameters in custom menu items, but I don't see an immediate way to do this.

#2

JonBob - October 14, 2004 - 14:27
Title:Some Menus Fail to Expand» Custom menu items with query string parameters fail to expand

#3

Anonymous - October 18, 2004 - 20:29

substr($_SERVER['PATH_INFO'],1)

Won't this do the trick?

#4

Robin Monks - June 14, 2005 - 00:08

Still here on latest HEAD.

Comment from chx:
I'd investigate request_uri() instead of $_GET['q'] ...

Robin

#5

dopry - March 10, 2006 - 09:43

This still applies... I tested again cvs HEAD.

#6

mariuss - July 17, 2006 - 05:30

Still seeing this issue in Drupal 4.7.2, and this is pretty bad if you cannot use clean url.

I have to disable clean URLs for a site and since now all URLs have a query string (i.e. /?q=...) submenus are totally broken. The active class is set for the selected menu item, but it is not expanded.

#7

Steven - July 18, 2006 - 05:50
Status:active» by design

Menu item paths are not the same as URLs. Query string parameters are not supported.

#8

gh0st25 - July 10, 2008 - 20:20
Version:x.y.z» 5.7

Why not? What if I am linking to a prefiltered search page? I don't want to create a bunch of nodes and logic for no reason.

 
 

Drupal is a registered trademark of Dries Buytaert.