I have updated from 7.x-3.0-rc5 to 7.x-3.0 and noticed that the Og Menu will not work for a user with access to only one group. If a user has access to multiple groups the correct menu will appear based on the group audience. However, if that user belongs to only one group, the Parent item is empty. I believe this is related to the fact that these content types were built with Og Menu 7.x-2.0, since I don’t have this issue with any sites built using only Og Menu 7.x-3.0.
Comment | File | Size | Author |
---|---|---|---|
#10 | og menu.jpg | 259.15 KB | bmsomega |
Issue fork og_menu-2392027
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
rv0 CreditAttribution: rv0 commentedDid you select the "Enable for OG Menus" setting on the content type?
Which type of widget are you using?
Is this on content creation or on content editing?
Are OG Menu permissions granted globally or on group level?
Comment #2
bspeare CreditAttribution: bspeare commentedYes, I have selected "Enable for OG Menus" setting on the content type. I am using the OG Reference widget, and this occurs on content creation and when editing existing nodes. And I am setting permissions at admin/config/group/permissions/node/group instead of for each individual group.
Comment #3
rv0 CreditAttribution: rv0 commentedOn content creation you need to have an OG context set from the url., and configure the og widget to listen to it.. are you doing that?
(sorry for the questions, just have to be sure before i start testing this)
Comment #4
bspeare CreditAttribution: bspeare commentedThanks for the help. I am setting the Groups audience from the OG reference widget - is that what you mean?
Comment #5
rv0 CreditAttribution: rv0 commentedCan you try latest dev and tell me if the problem is still there?
I'm afraid it's hard to say whats going on without having a look at the og, og_menu and menu related tables in your database..
Comment #6
westonpay CreditAttribution: westonpay commentedBeating a dead horse here and I apologize. I just wanted to confirm this is still an issue even with 7.x-3.x-dev. I am running OG 7.x-2.9. If a user belongs to only one group the parent item dropdown is empty.
Comment #7
rv0 CreditAttribution: rv0 as a volunteer commented@westonpay
I'm 100% sure this works when a user only has one group.
are you sure it is not permission related?
How/where are users given access to the OG (!) menu ?
Comment #8
bmsomega CreditAttribution: bmsomega commentedHi,
I'm using version 7.x-3.1 and I'm experiencing this issue as well.
I'm thinking that this is a javascript issue. Since the parent menu selection is triggered by selecting a group within the Groups Audience field, users can’t select a parent menu item because there isn’t a chance to actually select a group if the user is only part of one group.
Comment #9
rv0 CreditAttribution: rv0 as a volunteer commentedsee my previous post.
there is a configuration reason for this, but without knowing your exact config I cannot help
Comment #10
bmsomega CreditAttribution: bmsomega commentedA work-around that worked for me was reconfiguring the Groups Audience field widget from "OG reference" to anything else and then back to "OG reference". Doing this messed with the field settings a little bit so I had to make sure my field was configured correctly as well.
Before, the Groups Audience field was being automatically populated by the only group the user was a member of. Now instead, after doing that reconfiguration, the Groups Audience field now shows "Select a value" and the user needs to select the group. (See attached image)
Not sure if this sheds any light as to why I was experiencing this problem.
Comment #11
rv0 CreditAttribution: rv0 as a volunteer commentedthere must have been something different then in your field config
if you have a backup and could roll back, this might help people experiencing this issue
Comment #12
drummA key part of this looks like the cardinality setting for the OG group ref field. Changing it from 1 to unlimited seems to have triggered this on www.drupal.org. The widget as the affected user sees it is a single select field, but og_menu.js is processing it as cardinality != 1 and is looking for a multi-select field.
Drupal.ogMenu.selected
ends up being something like[3, 0, 2, 5, 7, 6, 8]
instead of[3025768]
Comment #14
drummMR !1 checks the
multiple
attribute of the HTML element instead of trusting the select element to match the field cardinality.Comment #15
rv0 CreditAttribution: rv0 as a volunteer commented@drumm
Seems like a proper solution, and nice to see some light on an issue from 2014
I don't have access to any D7 sites with OG Menu, or any development environment with a proper configuration for it.
Could you provide exact steps to reproduce the issue? (field and widget setting and whatever else is relevant?)
Thanks in advance
Comment #16
drummI spotted where the single/multiple select list switch happens: https://git.drupalcode.org/project/drupal/-/blob/7.77/modules/field/modu...
I don’t have a clean development environment with all the steps to reproduce. I think the key parts are:
(We do have www.drupal.org’s configuration exported at https://git.drupalcode.org/project/drupalorg/-/blob/61514c71f32a3e85e098..., but I don’t expect that to be too helpful as the module has a lot of unrelated baggage.)
Comment #18
rv0 CreditAttribution: rv0 as a volunteer commentedA new 7.x-3.3 release is coming, thanks for your contribution!