I get this when I try to delete a series of comments.

EntityMetadataWrapperException: Unable to load the comment with the id 7. in EntityDrupalWrapper->value() (line 623 of /sites/all/modules/entity/includes/entity.wrapper.inc).

CommentFileSizeAuthor
#7 entity_tokens.patch1.8 KBfago
#6 entity_tokens.patch1.79 KBfago
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geerlingguy’s picture

I'm getting the Exception after updating to latest -dev (or latest stable release) along with Rules, OG and Pathauto.

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

I get this when I try editing any node, or saving any new node.

Running dpm($this->propertyInfo);, I see that the properties array doesn't contain that field in it. However, I'm wondering why the getPropertyInfo function is calling properties for a field that's not used for the particular content type I'm trying to edit.

The 'field_short_name' field is only used for a 'parish' content type. When I try editing an 'event' content type, this error is thrown. If I edit a 'parish,' the error is not thrown. I'm wondering if it might have to do with token evaluation, since token needs to run through all fields...?

geerlingguy’s picture

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

Moving to -dev, as error still occurs there.

madeby’s picture

Yes, just tested it with latest DEV from Jan 20. and it still comes up with:

EntityMetadataWrapperException: Unable to load the comment with the id 1. in EntityDrupalWrapper->value() (line 650 of /sites/all/modules/entity/includes/entity.wrapper.inc).

When I try to delete a comment. It should be noted that I use MOLLOM and set it to "Do no report" when I try to delete it.

Bart Vanhoutte’s picture

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

I am experiencing similar issues when checking out in Übercart (Weight quotes enabled).

EntityMetadataWrapperException: Unknown data property order_total. in EntityStructureWrapper->getPropertyInfo() (line 294 of /usr/local/websites/drupal7/sites/all/modules/entity/includes/entity.wrapper.inc).

Bart Vanhoutte’s picture

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

Changed version info, my bad.

fago’s picture

Title: EntityMetadataWrapperException » Using entity tokens may cause entity wrapper exceptions
Status: Active » Needs review
FileSize
1.79 KB

Generally, this exception will appear if any module tries to get a value for a not existing property / passes an invalid entity id. Usually, it's up to the causing module to fix this, so best open separate issues for those modules.

Ad #1:
I just tried enabling pathauto + token + entity tokens, but everything is fine. Also mass-deleting comments. However, I see that there could be a problem in entity tokens causing such exceptions, when tokens of a not existing field are used (e.g. if the field is not present on the given node), or chained tokens where some part of the chain is not set. The attached patch should fix those cases by ignoring the token. Please test.

fago’s picture

FileSize
1.8 KB

grml. Fixed indentation, broken by broken eclipse config.

Bart Vanhoutte’s picture

Applied the patch, seems to work. Leaving status on "needs review" for further review.

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

Works great for me - clears up the error, patch makes sense.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Great, committed.

Status: Fixed » Closed (fixed)

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

chidosoft’s picture

pls how do I apply the patch. thanks

chidosoft’s picture

Issue summary: View changes

If anyone send comment on my site, it throws this exception

EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438 of /home/www/mydomainnamehere/sites/all/modules/entity/includes/entity.wrapper.inc).

i have tried i i could but couldn't i was able to get a clue to disable message module and all that came with it and now i can post comment correctly. this is just to help others.

Thanks