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.
Every time a user tries to leave a comment on any type of node it throws the following error:
EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of /sites/all/modules/entity/includes/entity.wrapper.inc).
We're getting ready to promote the ability to review businesses, as well as launching a photo contest, so the ability to leave comments is vital.
Thanks!
Comments
Comment #1
thelocaltourist CreditAttribution: thelocaltourist commentedUPDATE: This error occurs when Message module's Message example is enabled.
Comment #2
iadegesso CreditAttribution: iadegesso commentedHere the same issue.
I can confirm that the problem occurs when the Message module is active.
I upgraded the Message module to the development branch but nothing changed.
Any idea?
Comment #3
iadegesso CreditAttribution: iadegesso commentedIt seems that the 'format' property has cannot be obtained from the parent 'object', but I didn't understand where the 'format' property is defined and which is its parent...
Any helpful idea?
Comment #4
Mile23Similar error on the Message module's issue queue: #1992118: EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in Entity
I'd wager the problem is there.
Comment #5
sylvaticus CreditAttribution: sylvaticus commentedsame error and same module involved: message_notify_example ...
Comment #6
makokis CreditAttribution: makokis commentedsame issue here:
EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. en EntityStructureWrapper->getPropertyValue() (línea 442 de .../profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
Comment #7
Alexander Allen CreditAttribution: Alexander Allen commentedComment #8
pavi_raghu CreditAttribution: pavi_raghu commentedHi,
I am also getting error when leaving comments in my website, the error is EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of /xxx/sites/all/modules/entity/includes/entity.wrapper.inc).
please help me
Comment #9
eft CreditAttribution: eft commentedThis is likely fixed in the dev version. See #2108283: Entity language info missing.
Comment #10
makokis CreditAttribution: makokis commentedthis patch do no works for me (2 error):
1*-No se pudo enviar el correo electrónico. Contacte con la administración del sitio si persiste el problema.
2-EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. en EntityStructureWrapper->getPropertyValue() (línea 438 de /home5/teleinfo/public_html/profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
*1- it says than can't send the message. Contact with the website administrator if the problem persists
that's happend to me when leaving a comment of a product or news
thanks for help
Comment #11
eft CreditAttribution: eft commented- Are you sure the patch applied cleanly? Did you check the following file?
/home5/teleinfo/public_html/profiles/commerce_kickstart/modules/contrib/message/message.module
- Did you clear the cache?
Comment #12
makokis CreditAttribution: makokis commentedno i did't... !
Applied #2108283: Entity language info missing. again and cleaning cache now it works fine
many thanks #11, eft
Comment #13
cmonnow CreditAttribution: cmonnow commentedWhile I could be mistaken, I'm pretty sure that the error regarding "Unable to get the data property format..." (note the emphasis on format) when inserting a comment is due to code in:
message_notify/plugins/notifier/abstract.inc
Specifically these lines:
The error occurs in the "comment insert" message type for the field_message_rendered_body field (and not the field_message_rendered_subject field) since it's a textarea that by default allows filtered text types to be selected (i.e. in Managed Fields, select the rendered body field and you'll see "Filtered text (user selects text format)" checked under "Text processing"). I haven't investigated fully yet but the bug can be avoided by selecting "Plain text" under "text processing" in the meantime (which will bypass the empty $wrapper->type->{MESSAGE_FIELD_MESSAGE_TEXT}->get(0)->format->value() in the ELSE statement).
---------------------------------------------------------------------------------------------------------------------------------------
As an aside, if you instead receive errors regarding things other than "format" in "Unable to get the data property ..." (such as field_comment_ref etc) you probably have a failed installation of the message_example module (or more specifically, its "features" (rather than this bug with the message_notify_example). The database tables for the example fields probably didn't finish installing after some encountered error (you can manually delete the database tables that were setup before failure at your own risk to allow reinstallation of the example module/features - uninstallation of the module will not remove these tables).
Finally, most other failures are simply due to languages and formats not being set correctly in the *_example.features.inc files for your setup. For example, you might have to change "und" to a specific language (such as "en") and if necessary, change the text format from "full_html" to an existing machine name (or setup a new one). Note that some default settings for text formats (e.g. WYSIWYG in Panopoly) will cause issues for URL tokens used in hrefs.
e.g.
Comment #14
markbannister CreditAttribution: markbannister commentedSolution is actually simple.
Message Notify Example creates and new message type "Comment insert" (Machine name: comment_insert) (messages at "admin/structure/messages") but does not fill in the default values. Edit the message, fill in a default value for the subject, save, error goes away.
Comment #15
shanahan@virtualwavemedia.com CreditAttribution: shanahan@virtualwavemedia.com commented#14 Fixed it for me. I just disabled the module "Message Notify Example". I wished I'd come across this 10 hours earlier! My problem was with Comments on Posts.
Comment #16
igorik CreditAttribution: igorik as a volunteer commented#14 works for me, I added a description into the message_type comment_insert, and after then there was no problem with inserting comments.
Could maintainer please fix this in the module? It looks like this issue is already 3 years old and the bug is still active.
Thanks!
Comment #17
wcweb CreditAttribution: wcweb commentedThank you Shanahan #15
Comment #18
lubwn CreditAttribution: lubwn commented#14 worked for me. Also I disabled message notify example and message example modules.
Comment #19
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented