Closed (fixed)
Project:
Panopoly
Version:
7.x-1.x-dev
Component:
Widgets
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2017 at 19:13 UTC
Updated:
3 May 2017 at 21:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dsnopekHere's a patch that implements this!
Comment #3
cboyden commentedThe patch does what you expect when you save the widget, but if you reload the page, the full depth of the menu is displayed.
To reproduce:
Also, when I added this patch to an already-installed Panopoly site, I saw this notice on a page with an existing submenu widget:
Notice: Undefined index: expanded_max_depth in panopoly_widgets_menu_block_tree_alter() (line 499 of /panopoly/modules/panopoly/panopoly_widgets/panopoly_widgets.module).Comment #4
dsnopekDid you clear caches after applying the patch? This depends on alterations to the CTools content type, which won't actually happen until a cache clear. This would also be the source of the notice -- that can only happen if the content type info hasn't been altered.
Comment #5
cboyden commentedYes, caches are cleared. If you clear caches, then repeat steps 7 through 12, you should see the same results.
Comment #6
dsnopekOk, thanks! I've finally gotten around to actually trying this, and you're right!
I'm really not sure how the PHP notice is possible - since the CTools content type has a default for that config value, it should always be set... But whatever, it's easier to just fix rather than go spelunking in CTools to see what's going wrong.
The actual bug, though, was a logic problem with handling the active trail. If a link was part of the active trail, it wouldn't descend to it's children, where it should just not removed the link itself, but still descended to its children.
Here's an updated patch!
Comment #7
cboyden commentedThanks @dsnopek, the updated patch is working as expected.
Comment #9
dsnopekAwesome, thanks! Committed :-)