When editing a group node, which already has a menu, "Enable menu for this group" remains unchecked.
og_menu_get_menus() is called in og_menu_node_prepare() but it doesn't return the existing menu correctly. I believe it's because the group id should be carried in the arguments.
Attached a patch which fixes the problem for me.
| Comment | File | Size | Author |
|---|---|---|---|
| og_menu_fix_enable_menu_for_this_group.patch | 726 bytes | juhaniemi |
Comments
Comment #1
rv0 commentedMakes sense, og_menu_get_menus() without arguments just gets all og menu's (regardless of the og) that belong to the user, so this is wrong indeed.
committed your patch with a minor edit: http://drupalcode.org/project/og_menu.git/blobdiff/5f5dfe6bc5dfb466cf357...
thank you!
Comment #2
jastraat commentedSadly, the fix for this causes a PHP error when creating a new group because $nid has not yet been set. Suggestion:
Comment #3
juhaniemi commented@jastraat: I just tested creating a new group, and didn't get any errors. The menu was created correctly. $node->nid is available in hook_node_insert(), which is called after the group has been created.
Which version are you using?
Comment #4
jastraat commentedI downloaded the latest dev today. (packaging script on 2011-11-03)
Comment #5
jastraat commentedThis hook_node_prepare that is causing the problem btw -
Comment #6
rv0 commentedCome to think of it,
the initial problem
"When editing a group node, which already has a menu, "Enable menu for this group" remains unchecked."
was never there afaik :s
This week I wont have time to delve into this.. all I can do is roll back the patch for now..
Comment #7
jastraat commentedLooks like the original patch is still in the current dev; still getting that PHP error on group create.
Comment #8
rv0 commentedReverted this patch...
I cannot reproduce the original issue
Comment #9
rv0 commentedWorks here, No feedback, closing this.