Getting this error on the Drupal db update page.

Notice: Undefined index: membership_type in og_entity_property_info() (line 236 of /home/.../public_html/profiles/commons/modules/contrib/og/og.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

Does the error recur, or does it only happen when you run update.php?

bjprodneyl’s picture

Hi,
It only appears when I run update.

debain’s picture

Same problem, paste this code inside the foreach loop near line 236:

print("<pre>");
//print_r($field_info);
echo "$field_name :" . $field_info['settings']['handler_settings']['membership_type'];
print("</pre>");

Run cron (and watch output). You should see an empty field...

silkogelman’s picture

I ran into the same 'Notice: 'Undefined index: membership_type in og_entity_property_info() (line 236'
with Commerce Kickstart 2.4.

Localization on
Drupal 7.20
Organic Groups 2.0

silkogelman’s picture

In my case this happens when running update.php
and when editing a Drupal Commerce Product Display page.

The Product Display page references a Drupal Commerce product, and the product references an Organic Group.

WebSinPat’s picture

I am getting the same error, in a commons 3.2 install.

I see the error (same error printed about a dozen times) when i clear caches and run cron.
And every so often as i'm just navigating the site and doing a page load, I will get the error (just printed once or twice in this case). It does not repeat if i reload the same page.

thanks.

t.payne’s picture

bumping this
More or less a clean installation (though I have done a little tinkering with other parts of the installation, but not with anything OG)

Notice: Undefined index: membership_type in og_entity_property_info() (line 236 of /home/p21r7220/public_html/sites/all/modules/og/og.module).

A patch of temp fix would be awesome, since thats not looking promising... any ideas on what it is I am looking for when I start to debug would be great as I am 100% new to OG (but not drupal)

I have read all the comments in this thread (and though there are a few theories at to the problem there is nothing definitive)

edit: spelling

t.payne’s picture

Issue summary: View changes

Removed uneccessary path info.

lsolesen’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Fixed

Closing old inactive issues. Please reopen if the problem persists in recent 3.15 version of Commons.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rodriguesribeiro’s picture

Hello,
same here, any hint please?
Many thanks in advance
ER

Tankeroo’s picture

I'm getting the same error for line 236.

membership_type in og_entity_property_info() (line 236

No idea how to fix it. Also, not a lot of results come up when searching for a fix.

debain’s picture

Have you done what i have written in #3 ? What is the output?

Tankeroo’s picture

Yes, I did. Thanks! Here's what I got.

This is the original freach

      // Add OG membership per field in a bundle.
      foreach (og_get_group_audience_fields($entity_type, $bundle) as $field_name => $label) {
        $params = array('@label' => $label);
        $field_info = field_info_field($field_name);
        $group_type = $field_info['settings']['target_type'];
        $info[$entity_type]['bundles'][$bundle]['properties'][$field_name . '__og_membership'] = array(
          'label' => t('OG membership from field @label', $params),
          'type' => 'list<og_membership>',
          // The bundle in this context means the OG membership type.
          
          'bundle' => $field_info['settings']['handler_settings']['membership_type'],
          'description' => t('A list of all OG memberships registered in field @label.', $params),
          'getter callback' => 'og_get_field_og_membership_properties',
        );

When I insert your code here:

      // Add OG membership per field in a bundle.
      foreach (og_get_group_audience_fields($entity_type, $bundle) as $field_name => $label) {
        $params = array('@label' => $label);
        $field_info = field_info_field($field_name);
        $group_type = $field_info['settings']['target_type'];
        print("<pre>");
        //print_r($field_info);
       echo "$field_name :" . $field_info['settings']['handler_settings']['membership_type'];
       print("</pre>");
        $info[$entity_type]['bundles'][$bundle]['properties'][$field_name . '__og_membership'] = array(
          'label' => t('OG membership from field @label', $params),
          'type' => 'list<og_membership>',
          // The bundle in this context means the OG membership type.
          
          'bundle' => $field_info['settings']['handler_settings']['membership_type'],
          'description' => t('A list of all OG memberships registered in field @label.', $params),
          'getter callback' => 'og_get_field_og_membership_properties',
        );

I get the following.

og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_vocabulary :
og_group_ref :og_membership_type_default

When I insert the code near the beginning before $params, I get this:

og_group_ref :
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_group_ref :og_membership_type_default
og_vocabulary :og_membership_type_default
og_group_ref :

If I enter your code after the whole $info[entity_type] array, I get the same results as the first where og_vocabulary is empty.

I don't know exactly how to debug this.

EDIT: Added more details.

debain’s picture

Unfortunately i can't remeber exactly how i solved this issue. I am sure it was a setting in the field or the content.

Now we are sure it has something to do with the og_vocabulary. Have a look at that field, something is missing there. Are there (old) nodes where the value (of that field) is not set? Set it or remove that nodes.

(The message is a notice, not an errror, maybe you could simply ignore it: write a function that checks if the value is empty... )

lsolesen’s picture

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

I think it's fixed now. Thanks to your advice, I found the og_vocabulary field and just deleted it.
Used Taxonomy instead.

Kudos debain!

lsolesen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.