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
what would be the correct type then? callback?
#2
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
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?
#4
Probably. That's how the menu items for node/add get generated, for example.
#5
There, fixed the issue title for you.