Closed (fixed)
Project:
Organic Groups Menu (OG Menu)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2012 at 17:03 UTC
Updated:
11 Dec 2016 at 20:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bulldozer2003Here is my rewrite of og_menu_form_node_form_alter() and associated code.
Comment #2
rv0 commentedI will need to review this thoroughly
One a sidenote, check the comments/discussion in #1847110: Menu affiliation lost when editing a node in a group, improve menu settings on administer node type form.
Comment #3
bulldozer2003I don't suffer from #1847110: Menu affiliation lost when editing a node in a group, improve menu settings on administer node type form. after applying my patch. I had to rewrite parts of og_menu_node_prepare(), this is a major (good :) patch.
Comment #4
rv0 commentedTesting the patch
can't get it to work the way it should.
I created a normal user and made him member of the group.
I gave normal members the "administer menu" permission (on group level)
Normally I would expect then, if I add a node to the group with this user, I would see the menu.
In ideal case, the user is only possible to add pages linked to groups he has access to.
he would use the link node/add/group-page?og_group_ref=4 (in my case)
In node_prepare we can already provide the correct menu data. This does not seem to happen.
I retried with admin. Same thing, menu selection does not show up at all.
Tried to see what happens in the code.
You lost me around
$ids is an array
if i'm gonna array_keys that, i'll array(0 => 'group'); and not the group id's at all..
Help is welcome if I'm doing something wrong, but I can't commit this if I even can't get the basic functionality to work.
Comment #5
bulldozer2003Absolutely agree.
Most of my patches get tested and pushed to my production intranet before getting submitted here.
Which commit of OG are you using, somewhere back a couple of commits, they switched the way getReferenceableEntities() returns results, then when I last did a git pull, the return had switched back. I was going to update this patch, but then the change reverted so I no longer needed to.
My code here is assuming $ids is an array of gids and group_names of one entity typed, keyed by the gid.
I'll check is against the latest OG head right now.
Comment #6
rv0 commentedIf you are on #drupal IRC you may be able to contact me more directly
Comment #7
bulldozer2003Needs to be updated to the new format getReferenceableEntities() spits out results in an array of bundle types.
Comment #8
bulldozer2003Ok, this has been updated to account for #1821060: Return values from getReferencableEntities() keyed by bundle
Comment #9
rv0 commentedCommitted!
Thanks for your hard work.
Next up:
In #3 you say:
Actually, I just tested. Menu _IS_ lost under the conditions mentioned in #1847110: Menu affiliation lost when editing a node in a group, improve menu settings on administer node type form.
I renamed that issue and ongoing development will happen there.
Comment #11
xjm