I'm getting the following error when I go to the review stage of the checkout:
EntityMetadataWrapperException: Unable to get the data property type as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of \sites\all\modules\entity\includes\entity.wrapper.inc).
I'm also getting an EntityMetadataWrapperException when trying to upgrade from rc2 to rc3 at update.php. I've disabled all the modules that are taking part in the checkout process (coupon, checkout progress, a couple of custom modules and even the flat rate shipping module) and am still getting this error.
Thanks in advance
Comments
Comment #1
msmithcti commentedOK so I've come at it from another angle today and it was something fairly simple: I think something had gone wrong with the particular order I was using to test things. All I had to do was manually complete the order (I suppose I could have deleted it).
Comment #2
lukusI'm receiving this error at multi-stage checkout.
If I complete the order details, proceed to review, go back to order details and then try to proceed to review this error fires up.
Comment #3
lukusComment #4
lukusAs an update:
Comment #5
NewZeal commentedI want to bypass the default shipping radios too, but when I disable the collect 'shipping methods' rule then of course I have no shipping rule at all. I tried replacing with 'calculate the shipping quote for a line item' and I get further problems with the required parameter, and ultimately shipping does not show. I can live with the shipping radio but the EntityMetadataWrapperException makes it a bit difficult for people to buy stuff off the site.
Comment #6
NewZeal commentedProblem solved. I found it was a bug with commerce_shipping. Solution can be found here: http://drupal.org/node/1498484
Comment #7
jrviorato commentedI apply the patch suggested on http://drupal.org/node/1498484 to commerce_stock.module, and the problem disappeared. But I think the problem is on Commerce Shipping Module, because the problem occurs when we go to Review with a shipping line item on the cart, then the code
throws the error. This instruction is present on Commerce Stock because they need to check that the cart item is of type product, ie, a type that belongs to
commerce_product_line_item_types().Comment #8
rszrama commentedLooks like this issue was resolved elsewhere, and there's a possibility it was a core issue that has since been resolved. Please reopen this with more details on the Shipping bug itself if it resurfaces.
Comment #9
TyrelDenison commentedI am having this issue and the patch suggested in #6 and #7 is not resolving it. The exception occurs when I am deleting an order with a rule. I have both shipping and stock installed on my site. It seems to be related to the mixture of the two, which I need on my site. Here is the backtrace.
If you need any more details let me know. I'll be beating my head against this until it's done, because of course, a last minute feature request (stock) broke the site right before launch.
Update
Even after uninstalling the stock module, I get the same error. The exact context that produces the error is as follows:
-A customer enters an address into the shipping address that the client cannot ship to. A rule created to manage this fires, deleting the cart order and redirecting the customer to a page that explains what has happened.
Only now, they end up at the error page. The cart order seems to be deleted nonetheless.
Update 2
After further digging, all fingers are pointing to Entity API. According to this thread (http://drupal.org/node/1541792) an issue was initially triggered by an update in core. It seems the update exposed something with how the module handled taxonomy (http://drupal.org/node/1556192). I have not however found this exact exception listed in the Entity API issue queue, nor have I been able to connect the dots between the Entity issue mentioned above and the exact exception I receive. I have created an issue in the Entity issue queue (http://drupal.org/node/1596594) to facilitate a conversation with the people who maintain it about this issue. I am leaving the status as active here to get some thoughts on if I am following the right rabbit.
Comment #10
TyrelDenison commentedComment #11
TyrelDenison commentedI am still fighting this bug and am becoming more convinced it has to do with the shipping module. I have disabled the stock module, but the issue persists. As mentioned in #4, if I disable the 'collect shipping methods' rule, the error doesn't occur. I have rewritten my order delete method(mentioned in my first post) to side-step this bug, but I consistently get the error with the following actions.
1.I take an order all the way to final review as an anonymous user.
2. I click go back at the bottom of the page.
3. On the next page(checkout page) I click cancel at the bottom of the page, returning to the cart page.*
4. Boom.
At that point I get the following error.
*note that I can go to the /cart page straight from the review page by using the url with no errors
At this point, the customers order is broken beyond repair, and a browser cache flush is necessary for them to be able to order anything. The page still has update and checkout buttons, along with the nasty error. If you click either of these buttons...Boom again. New error below(which I believe is a result of the order being blown to bits).
I am going to do a clean build and see if I can replicate this error with that. All help/input is greatly appreciated as this bug has been discovered on a live commerce site. I will keep updating as I narrow things down.
Update
The order does not actually blow up as in deleted. I have created a php page to look for the order number and it is still there. I simply cannot do anything with it(hence the need for cache clearing). I can also access the order information by viewing the checkout/order-number page, but click on any links there will also produce the second error.
Comment #12
googletorp commentedThe exception you are getting is not related to commerce_shipping unless commerce_shipping some how to remove the commerce_shipping field, but I doubt that to be the case. Commerce shipping might be triggering this issue but I doubt that it's the actual cause.
Comment #13
rszrama commented(And you might check to make sure that the Total price field exists on Line Items in your "Field List" report. If not, use Commerce Repair.)
Comment #14
TyrelDenison commentedThanks for the input gentlemen. I have checked my field list report and commerce total is there. I have built a new site and have added shipping, shipping flat rate, and commerce stock. So far, I cannot replicate the problem. Is it possible this is somehow related to my database? I am at a bit of a loss and trying to fix this quickly.
Update
I am also getting this error when I run a status report.
Is it possible the two are related?
Comment #15
rszrama commentedIt could be you just had a line item with some stale data referenced by your existing order caused during testing. That happens occasionally, and you can recover from it by simply deleting your current cart order and starting a new one.
Comment #16
TyrelDenison commentedRyan
It is definitely due to some stale reference, but I am not sure who is trying to grab it. I originally thought it was the stock module, as others have mentioned a similar issue, but when I uninstalled that module, the problem persisted. I was able to step around the error by disabling the delete shipping line items rule from the workflow. It seems something was looking for the shipping items and not finding them. While I try and figure out who was looking for it and why, I will have to leave this rule disabled so the site remains functional, as it is currently a live site. What are the risks/downsides to having this rule disabled?
Comment #17
rszrama commentedI'm not sure there's a true risk here other than Shipping line items for orders that haven't completed checkout will hang around in instances where they may otherwise have been deleted. Still, the customer shouldn't be able to progress through checkout with an invalid shipping service selected. It probably depends on the type of shipping services you're offering and the logic used to make them available, but in most cases I don't think there's a drawback.
Comment #18
TyrelDenison commentedBest news I've heard all week. Thanks Ryan.
Comment #19
bb_dogg commentedI'm also getting this problem, and it definitely appears to be connected to commerce_shipping; at least it has to do with line items that don't exist anymore. I don't know if they where shipping line items, but for some reason they are now gone, and this breaks the total order calculation which causes this error in my case.
It might be related to me skipping saving in commerce_shipping_delete_shipping_line_items, which I use in my custom shipping method, so that might actually be the cause of the items still hanging around. So make sure you save the order if you use that function.
One solution would possibly be to check if the line item actually is valid before trying to do the calculations in commerce_line_items_total, but I'm not sure if that is the proper way of doing it.
Anyways, to get around it for now, I have chosen to log the error instead of throwing an EntityMetadataWrapperException, and which doesn't seem to be any drawbacks, and the totals are still calculated correctly.
Comment #20
rszrama commentedIf you're deleting shipping line items that are referenced by the order's line item reference field, then yes you do need to update the contents of that field and save the order. Start there, and if that doesn't resolve your issues we can investigate further. To a certain extent, we do have to depend on contribs to ensure they aren't breaking the data.
Comment #21
checker commentedCould be this related to #1673772: Address copying does not work if there are form errors before you activate the checkbox ?
Comment #22
Anonymous (not verified) commentedJust an FYI. I am getting this same error with no ecommerce modules enabled on my dev site:
EntityMetadataWrapperException: Unable to get the data property format as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442
Comment #23
mlaw commentedCommerce Modules enabled:
Commerce 7.x-1.3
Checkout Progress 7.x-1.2
Product Key 7.x-1.2
PayPal 7.x-1.x-dev
Shipping 7.x-2.0-beta1+18-dev
Flat Rate 7.x-1.0-beta1
The issue:
The error occurs after I go the Shipping page, choose a flat rate shipping method (radio buttons), and then click Continue.
EntityMetadataWrapperException: Unknown data property commerce_product. in EntityStructureWrapper->getPropertyInfo() (line 339 of C:\wamp\www\drupalck\profiles\commerce_kickstart\modules\entity\includes\entity.wrapper.inc).It crashes the site hard, and I can't continue anywhere else on the site unless I restart apache/sql/php or just delete all my browser cookies. I didn't receive the error prior to Commerce Shipping installation.
I've tried searching for a viable solution, but haven't found any yet. Any advice would be much appreciated! Thanks.
Comment #24
mlaw commentedSeems that my issue above in #23 was related to Commerce Product Keys. Temporary solution is a patch: http://drupal.org/node/1606378
Comment #25
rszrama commentedLet's close this back then.
Comment #26
ursula00 commentedI have a similar set up to #23 but running Commerce 7.x-1.5 and having the same issues. If the patch suggested fails why is this closed and would it be safe to apply this patch on a production site?
Comment #27
rszrama commentedIf you read above, you can see that the issue was caused by another module. That's why it was closed out here - Commerce Shipping isn't responsible for problems introduced by other modules. Are you perhaps using a similar other module? Can you provide steps to reproduce the problem in a clean install of Commerce Kickstart 1.x + Commerce Shipping? We'll need that before re-opening can go anywhere.
Comment #28
ursula00 commentedI assumed it was the shipping module as everything worked fine before I installed it. Nonetheless I applied the patch and all is working fine thanks!
Comment #29
perforator commentedI had similar problems with "giftwrap": https://drupal.org/node/2242325