Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Im trying to display "you are a " message on a group page. I have created a node variant to display panels for a group.
When I select "OG membership from a group node and user" context I get the following notice (x 2)
Notice: Undefined offset: 1 in og_membership_from_group_and_user_context() (line 28 of C:\vhosts\Drupal\social_1_0\sites\all\modules\og\plugins\relationships\og_membership_from_group_and_user.inc).
Comment | File | Size | Author |
---|---|---|---|
#9 | Screenshot from 2013-06-11 13:59:44.png | 33.91 KB | michaellenahan |
Comments
Comment #1
amitaibuDid you pass to the context the correct user and node?
Comment #2
amitaibu(i.e. make sure you have the user context available)
Comment #3
rogical CreditAttribution: rogical commentedThat context is for og group, not for og content, you may want to choose 'Group audience' context.
Comment #4
Dreao CreditAttribution: Dreao commentedsorry I am so new at this... I dont know what that means and if it fixes it... I can not get this to go away and searching brings me here... Thank you for any help, sorry if in wrong spot..
Notice: Undefined offset: 1 in og_membership_from_group_and_user_context() (line 28 of C:\Users\MasterEwok\Sites\acquia-drupal\sites\all\modules\og\plugins\relationships\og_membership_from_group_and_user.inc).
Comment #5
Dreao CreditAttribution: Dreao commentedComment #6
michaellenahan CreditAttribution: michaellenahan commentedI came across this error too, so here is my attempt to debug it (I don't know all that much about OG).
Put debug statements in the og_membership_from_group_and_user.inc file as follows.
In my case, this showed me that both $node_context and $user_context values were NULL.
I don't know how to proceed from here though.
In my case the problem is to do with a view I built, which uses the relationship "OG membership from node".
How do I "pass to the context the correct user and node"? I'm not sure what that means.
Thanks! :)
Comment #7
michaellenahan CreditAttribution: michaellenahan commentedComment #8
michaellenahan CreditAttribution: michaellenahan commentedIn my case the view pane is a block view pane. It shows up in a mini-panel on the page. Maybe the context needs to be added in the mini-panel settings.
Comment #9
michaellenahan CreditAttribution: michaellenahan commentedIn my mini-panel settings I have this dropdown. See attachment.
Is this what I should be using to get the context?
Any debugging tips that will help me find the right choice in the dropdown?
Thank you!
Comment #10
Yuri CreditAttribution: Yuri commented@micheallenahan Did you manage to solve this issue?
Comment #11
michaellenahan CreditAttribution: michaellenahan commented@Yuri, I'm sorry I'm not sure what happened in my case to fix this issue.
Comment #12
xiaomo CreditAttribution: xiaomo commentedI'm experiencing this issue as well.
Notice: Undefined offset: 1 in og_membership_from_group_and_user_context() (line 28 of sites/all/modules/og/plugins/relationships/og_membership_from_group_and_user.inc).