Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
First, thanks again for this great module, and sorry if this is covered somewhere else-- I searched but did not find.
My issue is with the little triangle icon next to my menu items that have only menu position rule children (by definition, disabled). My menu block menu is showing the menu link with the expanded, downward-pointing triangle (rather than the dot) but there are no enabled menu items below it.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1266816-8-unserialize-warning.patch | 722 bytes | JohnAlbin |
#7 | 1266816-7-unserialize-warning.patch | 1.39 KB | JohnAlbin |
#6 | 1266816-6-unserialize-warning.patch | 1.1 KB | JohnAlbin |
#2 | parent item not active | 54.64 KB | JohnAlbin |
#2 | parent item active | 39.7 KB | JohnAlbin |
Comments
Comment #1
JohnAlbinYeah, I see that too. But only with menu_block module blocks, not with core menu.module blocks.
Comment #2
JohnAlbinThis behavior has changed now that #1019342: Add current page's menu link at the end of the active trail has landed.
Hmm…
Here's the tree when a rule's parent item isn't the active link:
Here's the tree when a rule's parent item is the active link:
And here's the tree when a rule is active:
I can tackle the problem on the menu_block side, but I'm not sure if I can on the menu.module block side.
Comment #3
JohnAlbinFixed!
I figured out how to dynamically alter the parent menu links to toggle the "has_children" flag when the rule is active. Which means the parent menu link will show as a "leaf" when it is not in the active trail and when it is the active menu item. And will show as "expanded" when its child rule is active.
Yayz!
Actually the "Here's the tree when a rule's parent item is the active link" picture in #2 above of the menu_block block is still the same; its still showing as "expanded" when the parent menu link is the active menu item. But that is a bug in menu_block module; I'll have to open up an issue in that queue.
Comment #4
quartsize CreditAttribution: quartsize commentedThe update hook introduced with this fix appears to generate the warning
for every enabled menu position rule.
This can be reproduced by installing with the Standard profile, enabling menu_position-7.x-1.0-beta2, creating some rules, and upgrading to menu_position-7.x-1.0-beta3.
Comment #5
JohnAlbinBah. It looks like menu_link_save() has a bug in it. It assumes that the $existing_item parameter has a serialized options array item, which is just plain stupid.
The easy fix for this is to remove the $existing_item parameter and just let menu_link_save() do a db query to retrieve the existing item. That sucks since we already have the existing item out of the db, but since this work is only done on update or in the admin section, its not too bad.
Thanks for the bug report, quartsize! :-)
Comment #6
JohnAlbinHere's a patch.
Comment #7
JohnAlbinWell, that fixes the bug, but not the update. :-p
/me tries again.
Comment #8
JohnAlbinThe update path is more seriously broken then I realized. I'm fixing it over in #1305546: All rules are broken after upgrade to 7.x-1.0-beta3.
Here's a new patch.
Comment #9
JohnAlbinFixed.