MENU_NORMAL_ITEM wildcards must have to_arg callbacks

Arancaytar - November 7, 2008 - 00:31
Project:Audio
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

audio/by/% and audio/by/%/% are messing up the menu system by being declared as MENU_NORMAL_ITEM. This results in audio/by being printed as a non-leaf item, even though it has no sub-items.

(But at least now I know, after spending four hours on finding out why dhtml_menu caused a hard jQuery crash when audio was enabled. Talk about spooky action at a distance.)

#1

drewish - November 7, 2008 - 00:57

what would be the correct type then? callback?

#2

Arancaytar - November 7, 2008 - 01:43

I haven't quite decided. Setting them to callback fixes the immediate problem, but I'm not sure that's how they should work.

If the wildcard in audio/by/% is meant to be one of a specific number of tags, and each of these should be listed as a menu item, then you may need to iterate over the tags and create one menu item for each.

On the other hand, if "Browse by..." is meant to have no visible sub-items in the menu, then set them to callback by all means.

#3

drewish - November 17, 2008 - 08:58

well this gets the tag/value as a callback... not sure about the first one... i guess could loop over audio_get_tag_settings() and register separate callbacks for each?

AttachmentSize
audio_331159.patch 615 bytes

#4

Arancaytar - November 17, 2008 - 11:07

Probably. That's how the menu items for node/add get generated, for example.

#5

chx - June 24, 2009 - 17:14
Title:MENU_NORMAL_ITEM must not have wildcards» MENU_NORMAL_ITEM wildcards must have to_arg callbacks

There, fixed the issue title for you.

 
 

Drupal is a registered trademark of Dries Buytaert.