Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm guessing this is something to do with my environment but I've been unable to pin it down. I'm hoping for some clues. I'm using the og multiple block and it works perfectly except that it disappears to anonymous users. The block itself has no visibility limits placed on it and the block shows to all authenticated users whether in the group or not. Any suggestions as to what I might have missed?
Comments
Comment #2
presleyd CreditAttribution: presleyd commentedThis only seems to happen with OG 2.8. My sites on 2.7 do not have this issue and rolling back to 2.7 solved the problem on the affected ones.
However, testing on a clean site on simpletest.me does not have this issue so it's still a combination of things causing the problem.
Comment #3
rv0 CreditAttribution: rv0 commentedhm I haven't upgraded to the new 2.8 yet. Seems some architectural changes were made to context handling, where og_menu relies on heavily.
Will have to test.
Comment #4
presleyd CreditAttribution: presleyd commentedI'd be happy to test it again whenever you get a chance to look. I'll just stay with OG 2.7 for now.
Comment #5
presleyd CreditAttribution: presleyd commentedNow that OG has a security update to 2.9, I'm concerned about not being able to update. Granted, the security update doesn't really affect my setup but the warning that I'm missing a security update drives me nuts!
The OG Menu: single and OG menu: double blocks do not appear for anonymous users but both appear fine for authenticated users. It appears that og_context returns nothing for anonymous users.
og_context has changed so that it now has 4 parameters
If I set line 235 of og_menu.module to be
Then the og_menus reappear on my pages, however they don't show up on views where I've set a php header that defines the context. When I dpm the og_context function it seems that something else is calling it and removing the context for that views page but I haven't backtraced it yet.
I could create a patch for this but this doesn't seem like a great solution.
Comment #6
rv0 CreditAttribution: rv0 commentedThanks for this feedback. I've been allocated some time to work on this. A fix will come soon.
Comment #7
rv0 CreditAttribution: rv0 commentedI've not been able to reproduce this problem. In fact the latest dev seems to work just fine with OG 2.9 for me.
Yes, of course it will work if you ignore the access checks (the
FALSE
in og_context you posted above). However that's not a solution and doesn't touch the foundation of the problem..I think you have a config issue in your project, not really related to OG Menu.
- check if you have added any permission/access specific fields on admin/config/group/fields
- check if context handling is configured ok on admin/config/group/context
- are you using the "Organic groups access control" module?
Comment #8
presleyd CreditAttribution: presleyd commentedIndeed, I didn't suggest that it would be the correct solution. It does speak to the fact that access checks are causing the disappearance though.
Field permissions is enabled but there are no permissions set on the og ref or og_content fields.
Context handling is configured for node, comment, and URL (content create)
OG access is enabled. I disabled it but it did not fix the problem.
I appreciate the suggestions. I'll try disabling other modules and see if I can find more and post it here.
Comment #9
presleyd CreditAttribution: presleyd commentedContent access was to blame. We had it setup to not allow the group content types to be seen by anonymous users. (We override the group page using Panels and make it into a dashboard for managing group content). However, I can see how you can't determine context when you don't have access to the content that the og_ref field points to... We'll have to rethink how we do this.
Thanks for taking the time to look at it.
Comment #10
presleyd CreditAttribution: presleyd commentedFYI for anyone else who comes looking for this. I can't think of a problem with turning off access check for og_context here. It is just running on hook_block_view and I want anonymous users to view the menu but NOT the group node itself. So I changed line 248:
from
to
Comment #11
scotwith1tWe had a similar thing but it turned out it was just because the group in question was unpublished :)