I got the following error when trying to display: /user

EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() line 339 of /***/entity/includes/entity.wrapper.inc

Entity API 7.x-1.x-dev
OG 7.x-2.0-alpha2+48-dev enabled
Drupal 7.12

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jlyon’s picture

Status: Active » Fixed

This is fixed if you update to the latest version of entity api. From #1443152: Unknown data property gid. in EntityStructureWrapper.

Status: Fixed » Closed (fixed)

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

JHeffner’s picture

Version: 7.x-1.x-dev » 7.x-1.0

I'm seeing this error with Drupal 7.20 when trying to change the role of a user at /user/1357/edit

EntityMetadataWrapperException: Unknown data property og_membership. in EntityStructureWrapper->getPropertyInfo() (line 339 of /var/www/drupal7/sites/all/modules/entity/includes/entity.wrapper.inc).

JHeffner’s picture

I'm finding it's a conflict with UUID related to this issue http://drupal.org/node/1467820

lias’s picture

Status: Closed (fixed) » Active
Issue tags: +OG, +entity

I am getting the same error message using this version Entity API 7x-1 along with OG 7x-2

EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 339 of C:\Inetpub\wwwroot\domain\sites\all\modules\entity\includes\entity.wrapper.inc).

I have been posting og node content fine until this error. This is not a user entity but a node entity that has og membership in a specific group. I do not have UUID installed or the organic group example.

I did make one change before this started happening. I have a list - select list widget field in this group content and I just added an extra item to the list. I didn't add this item to the end but to the spot in the list it would sit alphabetically. Could that have caused this error?

apple|Apple
orange|Orange <--new item added alphabetically
pear|Pear

I believe this is a major issue.

sandipmkhairnar’s picture

I am also getting same issue while publishing order.

/www/rmghtml/sites/COM/R7/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).
EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 708 of /www/rmghtml/sites/COM/R7/sites/all/modules/contrib/entity/includes/entity.wrapper.inc)

oranges13’s picture

I am receiving this issue as well. However, we have two servers, one which presents the issue and one that does not.

The server with the issue is running several additional modules, such as Memcache and APC.

All caches have been cleared but the problem persists.

EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 335 of /sites/all/modules/entity/includes/entity.wrapper.inc)

Entity API 7.x-1.3 and OG 2.4

ranroz’s picture

Issue summary: View changes

@lsabug -
Can you please provide steps to reproduce this issue?

uschi_glas’s picture

@oranges13

had the same problem. solved by clearing apc cache directly. something like this:

 apc_clear_cache();
 apc_clear_cache('user');
 apc_clear_cache('opcode');
haydeniv’s picture

Status: Active » Closed (fixed)

No new info and all the other problems are solved so back to fixed.

nikita.izotov’s picture

EntityMetadataWrapperException: Unknown data property og_user_node__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 335 of /profiles/openatrium/modules/contrib/entity/includes/entity.wrapper.inc).

No fixes for this issue?

bdupls’s picture

This error appeared on a site that I have been working on for a while. I then created a new local Commons site and created a new content type and added the new content type to OG field settings. And this error appeared when I created new content. Only my error occurs on line 736
EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 736 of /Users/xxx/Sites/xxx/sites/all/modules/entity/includes/entity.wrapper.inc).
If I include this line on line 736 to cater for empty fields the error changes to line 335 at nikita #11 states he gets.
if (empty($node)) { return; }

People on this link are having similar problems on this site,
https://www.drupal.org/node/1925412

Chewie’s picture

Simple fix if for you not acceptable for now change version
Patch applicable for OG project

igorik’s picture

Status: Closed (fixed) » Active

I have this problem, but the patch #13 doesn't work for me...

EntityMetadataWrapperException: Unknown data property field_published. in EntityStructureWrapper->getPropertyInfo() (line 335 of /Users/igor/Documents/dev desktop sites/og/sites/all/modules/entity/includes/entity.wrapper.inc).

It comes when I try approve comment for the post in Organic group.
I found 2 errors in log:

type comment error

Type comment
Date Saturday, October 3, 2015 - 11:16
User admin
Location http://og.dd:8083/comment/1/approve?token=BvLHrBQdyLCHO8Xb5nlH5eCMMdz8ft...
Referrer http://og.dd:8083/node/9
Message EntityMetadataWrapperException: Unknown data property field_published. in EntityStructureWrapper->getPropertyInfo() (line 335 of /Users/igor/Documents/dev desktop sites/og/sites/all/modules/entity/includes/entity.wrapper.inc).
Severity error
Hostname 127.0.0.1

and type php error

Type php
Date Saturday, October 3, 2015 - 11:16
User admin
Location http://og.dd:8083/comment/1/approve?token=BvLHrBQdyLCHO8Xb5nlH5eCMMdz8ft...
Referrer http://og.dd:8083/node/9
Message EntityMetadataWrapperException: Unknown data property field_published. in EntityStructureWrapper->getPropertyInfo() (line 335 of /Users/igor/Documents/dev desktop sites/og/sites/all/modules/entity/includes/entity.wrapper.inc).
Severity error
Hostname 127.0.0.1

oranges13’s picture

Igorik,

Is your site running any caching modules such as APC or MemCache? This was making the problem occur on our site. When you create a new content type, the "site" cache was not aware it existed, thus the error. You had to forcibly clean the cache to stop the error from occuring.

Mykola Dolynskyi’s picture

Hi. I have same error trying to wrap the node.
It fails on field of type untityreference, but the bundle of node i wrap dont contain this field.

roynilanjan’s picture

Patch #13 is working with same issue! currently I'm using og veresion of 7.x-2.9. That fix is not available in this release
Fix should be the part of og.member.inc file

roynilanjan’s picture

Project: Entity API » Organic groups
Version: 7.x-1.0 » 7.x-2.9
Component: Entity property wrapper » og.module
Status: Active » Needs review
alexverb’s picture

Status: Needs review » Needs work

Putting back to needs work. There is functionality that prevents memberships for anonymous users:

    $entity_type = $this->entity_type;
    $etid = $this->etid;

    if ($entity_type == 'user' && !$etid) {
      throw new OgException('OG membership can not be created for anonymous user.');
    }

    $entity = !empty($this->entity) ? $this->entity : entity_load_single($entity_type, $etid);

And the function below from og.module accepts both id and entity. So the proposed patch 13 will most likely break functionalities.

/**
 * Return TRUE if a field can be used and has not reached maximum values.
 *
 * @param $entity_type
 *   The entity type.
 * @param $entity
 *   The entity object or entity ID.
 * @param $field_name
 *   The group audience field name.
 */
function og_check_field_cardinality($entity_type, $entity, $field_name) {
  $field = field_info_field($field_name);
  if ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
    return TRUE;
  }
  if (!is_object($entity)) {
    $entity = entity_load_single($entity_type, $entity);
  }
  $wrapper = entity_metadata_wrapper($entity_type, $entity);
  return count($wrapper->{$field_name . '__og_membership'}->value(array('identifier' => TRUE))) < $field['cardinality'];
}

Putting patch to hidden and back to needs work.

iarc13’s picture

Igorik,

Is your site running any caching modules such as APC or MemCache? This was making the problem occur on our site. When you create a new content type, the "site" cache was not aware it existed, thus the error. You had to forcibly clean the cache to stop the error from occuring.

#15 saved me Thanks oranges13.
I stopped and started memcache.