Closed (fixed)
Project:
Menu Position
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2011 at 16:14 UTC
Updated:
27 Oct 2011 at 22:40 UTC
Jump to comment: Most recent file
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 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.