I get error 'EntityMetadataWrapperException: Unable to get the data property name_line as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438 of /---/sites/all/modules/entity/includes/entity.wrapper.inc).' when checkout order and go to Review, after billing information.

My checkout setting are:
Checkout
-Shopping cart contents
-Account information
-Billing information

Review order
-No panes on this page.

Payment
-Review
-Payment
-Off-site payment redirect

Checkout complete
-Completion message

Comments

Lexus1990’s picture

It is not in payment module. I think it is in commerce core

pyxio’s picture

Hello,

I am having the same issue. Did you find the solution? Thank you. Kevin

Denial’s picture

Same issue here, please update with a fix if possible!

Exigo’s picture

Hi, I think i have also the same one. I run a donation site, so I really do not need billing or shipping information and removed those from the checkout (admin/commerce/config/checkout) but it provided no help to this error.

Other actions that I have tried to solve the error:

  • I have updated commerce to the latest version.
  • I also tried commerce repair but with no success.
  • I opened my product display node and the product reference field and saved it.

Other symptom is that CKEditor and wysiwyg works in my other content types, but not in my product display content type. Also the tabs in edit mode are broken.

Exigo’s picture

I managed to solve my problem with #13 https://www.drupal.org/node/2053821 but there can be other causes for EntityMetadataWrapperException.

Exigo’s picture

The error came back. Probably because of cache. Because I have a donation site I have tried to remove shipping and billing. If I take em out from checkout settings, the site breaks in checkout and from log I can see this error:

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

When I put them back site starts working but filling out address just to donate anonymously is not desired behaviour.

Lorenz Kraft’s picture

Hi all,

like the first answers states, i also think its a drupal core problem. There are several Google Results for several Modules when you search for "EntityMetadataWrapperException: Unable to get the data" .

But as many of us, we can not wait until someone somewhere fixes this core issue. So here is what i fixed:
File: ./profiles/commerce_kickstart/modules/contrib/commerce/modules/customer/commerce_customer.module
Function: commerce_customer_profile_default_label
Changed: Comment out "$label = $profile_wrapper->commerce_customer_address->name_line->value();"

I think this solution does work without drawbacks because the changed function has a fallback:
if (empty($label)) {
$label = $profile->profile_id;
}

Hopefully this will help people to NOT waste two days of diving into code thats not your own.

Greets,

Chris

pyxio’s picture

@Lorenz thanks so much for this.

TynanFox’s picture

Hi,
I'm continuing to have this exact same issue, but for me, it's happening after the payment gets processed on the order.

Customer types in CC number and clicks submit.
Payment processes, but checkout returns this error message.
If the customer refreshes the page, they are redirected to the correct display, however. The payment processes normally despite this error. Finally it's interesting to note that this error is only occuring for annonymous users. Authenticated users and administrators do not get this error after checkout.

I have the latest releases and patches to all the commerce modules I am using. I've searched this issue high and low and can't find the culprit.

Is anyone else still having this issue? I already tried the solutions in this thread and they didn't work for me.

anneeasterling’s picture

I was also experiencing what Tynan reported. When an anonymous user went through the checkout process, they were get a failure on the confirmation (or payment page depending on the setup). The log reported:
"EntityMetadataWrapperException: Unable to get the data property profile_id as the parent data structure is not set."

The solution for me was the patch here:
https://www.drupal.org/node/2682867#comment-11085523

The buggy module was Commerce Addressbook Extras. Hope that helps someone else (so they don't have to spend the hours it took me to disable/enable all of the commerce modules they are using) and that I've added enough keywords to help Google find this. :)

Thanks,
Anne