Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#7 | entity_tokens.patch | 1.8 KB | fago |
#6 | entity_tokens.patch | 1.79 KB | fago |
Comments
Comment #1
geerlingguy CreditAttribution: geerlingguy commentedI'm getting the Exception after updating to latest -dev (or latest stable release) along with Rules, OG and Pathauto.
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...?
Comment #2
geerlingguy CreditAttribution: geerlingguy commentedMoving to -dev, as error still occurs there.
Comment #3
madeby CreditAttribution: madeby commentedYes, 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.
Comment #4
Bart Vanhoutte CreditAttribution: Bart Vanhoutte commentedI 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).
Comment #5
Bart Vanhoutte CreditAttribution: Bart Vanhoutte commentedChanged version info, my bad.
Comment #6
fagoGenerally, 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.
Comment #7
fagogrml. Fixed indentation, broken by broken eclipse config.
Comment #8
Bart Vanhoutte CreditAttribution: Bart Vanhoutte commentedApplied the patch, seems to work. Leaving status on "needs review" for further review.
Comment #9
geerlingguy CreditAttribution: geerlingguy commentedWorks great for me - clears up the error, patch makes sense.
Comment #10
fagoGreat, committed.
Comment #12
chidosoft CreditAttribution: chidosoft commentedpls how do I apply the patch. thanks
Comment #13
chidosoft CreditAttribution: chidosoft commentedIf 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