1) Go to checkout.
2) Submit the page without filing the required address fields (page reloads with errors of missing values)
3) Select "My xxxinformation is the same as my xxx information. ".
I get this exception through ajax:
EntityMetadataWrapperException: Unable to get the data property commerce_total as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (442 von /entity/includes/entity.wrapper.inc).
I'm using current dev (2012-Jul-04). Can someone reproduce this error?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | auto_shipping_rule.txt | 384 bytes | checker |
| #10 | dc_checkout_error_auto_shipping.png | 61.33 KB | checker |
Comments
Comment #1
checker commentededit issue title
Comment #2
checker commentededit issue title again...
Comment #3
checker commentedI tested this with a fresh new installation and I can't reproduce my issue.
Comment #4
checker commentedThis bug happens on the following situation:
- using commerce_shipping
- using a rule that fires commerce_shipping_rate_apply() on "update existing commerce order"
So perhaps it is a commerce_shipping bug.
See:
commerce_shipping.module
commerce_shipping_add_shipping_line_item()
$order_wrapper->commerce_line_items[] = $line_item;
This line is not the root but causes the fatal error.
Comment #5
checker commentedComment #6
checker commentedComment #7
googletorp commentedAddress copying use what's created in Drupal Commerce core now - which is in dev. I don't know if that is what you do use - but moving it there for it to get resolved.
Comment #8
checker commentedSorry, the issue title is obsolete I guess. As I mentioned in #4 I 'm not sure if it is a address copying bug anymore.
The bug is similar to drupal.org/node/1379046#comment-6149814 #1379046: Getting a 'EntityMetadataWrapperException' error at checkout and on update.php
I will test it on a fresh installation again.
Comment #9
rszrama commentedYeah, from the looks it was originally based around Commerce's address copying but then transformed into a potential Shipping issue. Can you update the issue title when you recheck the problem?
Comment #10
checker commentedThis issue is reproduceable on a fresh installation.
Drupal Commerce 7.x-1.x-dev 2012-Aug-19
Commerce Shipping 7.x-2.x-dev 2012-Jul-25
Commerce Flat Rate 7.x-1.x-dev 2011-Dec-15
No customization.
Use case: If an order is updated also shipping costs should be recalculated.
Comment #11
rszrama commentedOn further testing, I can't confirm this bug. If I do the same process without using your rule to automatically apply shipping to orders on update, it works just fine. I think the problem is with your rule. The way the module works, you're not really supposed to be adding shipping like this, and especially not on an event that's going to be so constantly used as "After an order has been updated." Note that this is going to reapply shipping every single time the order is saved, even if the customer selected a different service or long after the order has completed checkout.
The particular error you're getting doesn't make sense if your order does in fact have the commerce_total price field on it (see the "Field list" report to confirm). If that field is there, then all I can figure is there's something jinky in the combination of rules you're creating, since there's another default rule that manually deletes shipping line items under certain conditions. The fact that this centers around address copying feels like a red herring, but it could be that in my work on address copying with respect to automatic recalculation of shipping services I have changed something that removes this error.
Comment #12
ivanbueno commentedI encountered this issue also. The error occurs inside the validation callback of the checkbox:
The issue is that the $form_state['order'] inside this function is already stale. The order inside this $form_state may contain commerce_line_items (shipping) that already has been deleted / "order updated" in the other form hooks in commerce_shipping.checkout_pane.inc.
Here's a temporary patch:
A better solution may be having a proper $form_state['rebuild'] = TRUE in one of the checkout panes.
Comment #13
checker commentedThere are some related issues like #1905234: Commerce Discount cause an error when reusing shipping address for billing