Problem/Motivation

- Enabled 'Commons Documents' under 'Commons - Content Types' (within 'Features')
- Add content of type 'document'
- When hitting 'save' receive the following error:
EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 339 of /pedata/var/www/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc).

Adding other content types, e.g. wiki page, seems to be ok

CommentFileSizeAuthor
#8 commons-features-documents.png11.31 KBbehoppe333

Comments

andyingham’s picture

Status: Active » Closed (fixed)

Updating 'Entity Registration' module to 7.x-1.1 fixed this problem for me.

stanlog’s picture

Hello, I've got the same problem with documents module. When I'm uploading the file, I've got the message :
"Warning: Invalid argument supplied for foreach() in entityreference_field_widget_form() (line 815 of /var/www/drupal/profiles/commons/modules/contrib/entityreference/entityreference.module)."
And when I click on "Save" :
"EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 339 of /var/www/drupal/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc)."

Anybody's know where is the bug ?
Thank you for your help.

Drupal 7.22
Commons 7.x-3.2

behoppe333’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Status: Closed (fixed) » Active

I see this error both with Commons 3.3 rc2 and a fresh install (drush make build-commons.make from just now)

Steps to reproduce the error:

  1. Fresh install including example content
  2. With UI go to admin > modules and enable Commons Documents
  3. Go to home page, select Documents tab, full form
  4. add document and save
  5. See error reported in original post: "EntityMetadataWrapperException: Unknown data property og_group_ref__og_membership. in EntityStructureWrapper->getPropertyInfo() (line 339 of mysite/profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc).
behoppe333’s picture

Version: 7.x-3.x-dev » 7.x-3.3-rc2
Priority: Normal » Critical
Issue tags: +Commons 7.x-3.3 radar

This bug occurs in 7.x-3.3-rc2+9-dev using steps of #3

With a fresh install, this makes Commons Documents useless. I cannot create any documents.

behoppe333’s picture

FYI: I upgraded an existing site to 7.x-3.3-rc2+9-dev and observe that documents work in that case. The problem may only occur with a fresh install.

japerry’s picture

Assigned: Unassigned » japerry

Confirmed. I could reproduce it as well.

japerry’s picture

Status: Active » Fixed

Please refer to #2065381: EntityMetadataWrapperException errors due to features not being reverted for reasons why its important to revert all features after enabling a feature in commons. We don't automatically revert all features because we don't want to destroy user customizations.

The easiest way to revert is with 'drush --force -y fra' if you have drush enabled. Warning: this will remove any customizations / overridden features you may have on your install. Proceed with caution!

Re-open if you feel that this message is in error and can be replicated after reverting all features.

behoppe333’s picture

Status: Fixed » Active
StatusFileSize
new11.31 KB

Thanks for looking into this japerry.

I am re-opening.

I observe the error with a fresh install. When I look at admin > structure > features > commons content types > commons documents, it says all values are "Default".
commons documents feature

My knowledge of Features module is extremely vague, but it seems to me like reverting is moot in this situation. And if there is something to revert, then like https://drupal.org/node/2052353 I am confused why reverting is called for when I have nothing but a fresh install.

japerry’s picture

Status: Active » Fixed

Since comments documents is not enabled upon installed (its an additional feature), Please refer to #2065381: EntityMetadataWrapperException errors due to features not being reverted for reasons why its important to revert all features after enabling a feature in commons. We don't automatically revert all features because we don't want to destroy user customizations.

In this case, groups add fields to the documents CT, and unless you revert those modules, the fields won't show up. Please refer to #2065381: EntityMetadataWrapperException errors due to features not being reverted for more information about this catch-case.

RobKoberg’s picture

there has a to be a better way of dealing with this issue.

"or reasons why its important to revert all features after enabling a feature in commons. We don't automatically revert all features because we don't want to destroy user customizations."

That last sentence contradicts the previous one, for all intents and purposes. Basically, you need to blow away all customizations to get the og_group_ref and/or og_group_user_ref on a single content type.

What about an admin/commons/group-types and admin/commons/user-group-types pages that provides a lists of content types with check boxes. On submit, the necessary setup/install occurs. Or perhaps there are hooks that can be implemented for the og admin field settings page.

Or what if all the features were enabled by default and you opt out of the ones you don't want?

japerry’s picture

By making the site builder manually revert, we allow them to do it on their own time, after they've read the documentation and verify they have no customizations.

But that discussion should be had in the meta issue, not here.

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