I receive the following error when trying to create documents inside groups:

EntityMetadataWrapperException: Unknown data property og_user_group_ref. in EntityStructureWrapper->getPropertyInfo() (Line 335 ......./profiles/commons/modules/contrib/entity/includes/entity.wrapper.inc).

If the document is not assigned to a group, it is no problem to create it.

cheers,
slowflyer

Comments

fathershawn’s picture

The Document content type is marked as group content in the content type settings but it lacks the og_group_ref field which causes an exception in commons_trusted_contacts_node_presave...

fathershawn’s picture

The Document content type is also missing group_content_access field.

fathershawn’s picture

Status: Active » Closed (fixed)

This is fixed in Commons 7.x-3.17 - just verified on a fresh install.

thatpatguy’s picture

I'm desperately trying to resolve the same issue. I'm running 7.x-3.17 which I just upgraded to today and it didn't resolve the issue. Do have to do a fresh install for this to get fixed?

When I made the upgrade I also completely uninstalled and re-installed the Commons Documents module, just to try and make sure I had cleared anything out of the database.

fathershawn’s picture

Well, thinking through my upgrade process - did you drush updb after upgrade or load the upgrade.php page?

A manual fix would be to look at a working content type such as Post, and note the three og related fields. Then add in any missing ones on the Documents content type as existing fields...

thatpatguy’s picture

FatherShawn, thanks for the idea of copying the fields from Post into Documents, for whatever reason that didn't occur to me and it worked.

I did, for the record, run update.php after updating Commons, so for whatever reason 3.17 wasn't working for me after the update, but adding in that field manually did resolve the issue. Thanks again.

slowflyer’s picture

@FatherShawn: What was necessary to get that done in code? Get the missing fields added?

I'm just trying to create a new group content type, copied everything from posts, but the commons fields for groups, radioactivity, topics are not added, only the media field is added.

(has nothing to do with the original post)

cheers,
slowflyer

geekdad’s picture

Thank you @FatherShawn. Added og_group_ref, og_user_group_ref and group_content_access to the document content type and it solved the problem.