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

thelocaltourist’s picture

UPDATE: This error occurs when Message module's Message example is enabled.

iadegesso’s picture

Here 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?

iadegesso’s picture

It 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?

Mile23’s picture

sylvaticus’s picture

same error and same module involved: message_notify_example ...

makokis’s picture

same 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).

Alexander Allen’s picture

Project: Entity API » Message
Component: Entity property wrapper » Code
pavi_raghu’s picture

Issue summary: View changes

Hi,
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

eft’s picture

This is likely fixed in the dev version. See #2108283: Entity language info missing.

makokis’s picture

This is likely fixed in the dev version. See #2108283: Entity language info missing.

this 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

eft’s picture

- 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?

makokis’s picture

- Did you clear the cache?

no i did't... !
Applied #2108283: Entity language info missing. again and cleaning cache now it works fine

many thanks #11, eft

cmonnow’s picture

While 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:

        // Get the format from the field. We assume the first delta is the
        // same as the rest.
        if (empty($wrapper->{$field_name}->format)) {
          $wrapper->{$field_name}->set($output[$view_mode]);
        }
        else {
          $format = $wrapper->type->{MESSAGE_FIELD_MESSAGE_TEXT}->get(0)->format->value();
          $wrapper->{$field_name}->set(array('value' => $output[$view_mode], 'format' => $format));
        }

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.

    "message_text" : { "en" : [
        {
          "value" : "\\u003Ca href=\\u0022[message:user:url]\\u0022\\u003E@{message:user:name}\\u003C\\/a\\u003E registered.",
          "format" : "unfiltered_text",
          "safe_value" : "\\u003Cp\\u003E\\u003Ca href=\\u0022[message:user:url]\\u0022\\u003E@{message:user:name}\\u003C\\/a\\u003E registered.\\u003C\\/p\\u003E\\n"
        }
      ]
    },
markbannister’s picture

Solution 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.

shanahan@virtualwavemedia.com’s picture

#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.

igorik’s picture

#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!

wcweb’s picture

Thank you Shanahan #15

lubwn’s picture

#14 worked for me. Also I disabled message notify example and message example modules.

bluegeek9’s picture

Status: Active » Closed (outdated)