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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Did you pass to the context the correct user and node?

amitaibu’s picture

Category: bug » support
Status: Active » Postponed

(i.e. make sure you have the user context available)

rogical’s picture

That context is for og group, not for og content, you may want to choose 'Group audience' context.

Dreao’s picture

sorry 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).

Dreao’s picture

Status: Postponed » Closed (fixed)
michaellenahan’s picture

I 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.

/**
 * Return a new context based on an existing context.
 */
function og_membership_from_group_and_user_context($context, $conf) {
  //
  debug($node_context);
  debug($user_context);
  //
  list($node_context, $user_context) = $context;

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! :)

michaellenahan’s picture

Status: Closed (fixed) » Active
michaellenahan’s picture

In 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.

michaellenahan’s picture

In 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!

Yuri’s picture

Issue summary: View changes

@micheallenahan Did you manage to solve this issue?

michaellenahan’s picture

@Yuri, I'm sorry I'm not sure what happened in my case to fix this issue.

xiaomo’s picture

I'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).