Congrats for this great module :)
I installed this module, created some fee rules. Now when ever I am trying to checkout, I am getting this error on shipping pane.
EntityMetadataWrapperException: Unable to get the data property commerce_total as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of /var/www/iread/sites/all/modules/entity/includes/entity.wrapper.inc).
I have shipping module as well as flat rate module enabled. I tried to search for this error & found so many discussion, people claiming about shipping module as reason for this. But if I disable your module, I don't get this. So I think, even if shipping module is the reason behind this, your module is somehow triggering something for this reason.
Can we some solution for this so that we can use it along with shipping module? You can ask me for more info if needed..
Thanks,
Comments
Comment #1
jasen CreditAttribution: jasen commentedConfirmed. I'm getting the same error.
Comment #2
facine CreditAttribution: facine commentedWhich version of commerce used?
This error should think fixed with this patch: #1423204: Add some self healing for order line item references
Comment #3
jasen CreditAttribution: jasen commentedI'm using Commerce 7.x-1.8, patch didn't work.
Comment #4
jasen CreditAttribution: jasen commentedAny other ideas?
Comment #5
facine CreditAttribution: facine commentedI tried it with a clean installation of "Drupal Commerce Kickstart" and have had no errors using "Commerce Shipping".
Could you provide any more information?
Comment #6
facine CreditAttribution: facine commentedIn a production site with many modules I get the following error when trying to add a line item to an order.
Right here: http://drupalcode.org/project/commerce_fees.git/blob/refs/heads/7.x-1.x:...
This error occurs when:
1) We are in "/cart" and click "Update cart"
2) Or when $order changes its state from "shopping cart" to "checkout"
If we refresh everything works fine, except that it has created a "line-item" type "fee" but not assigned to the order and other property assigned. #2099685: Orphan fee line-item
I do not think it's a matter of "commerce shipping" because with the kickstart works fine.
Is there someone using commerce shipping and not have this problem?
Thanks!
Comment #7
facine CreditAttribution: facine commentedI created an issue in commerce module #2098991: EntityMetadataWrapperException when assigning a new line-item to an order wrapper.
Comment #8
dj1999 CreditAttribution: dj1999 commentedSame for me.
Comment #9
kepesv CreditAttribution: kepesv commentedsame here
Comment #10
kepesv CreditAttribution: kepesv commentedComment #11
mibfire CreditAttribution: mibfire commentedSame using commerce 1.8. https://drupal.org/node/2191499
Comment #12
mibfire CreditAttribution: mibfire commentedThe error happens when "shipping service" is moved to the checkout page or to other page(didnt try).
Comment #13
georgemastro CreditAttribution: georgemastro commentedI had the same problem even when I wanted to see the page of a single product. I erased all the orders from the database, reinstalled the fees modules and everything works fine now.
Comment #14
Zekvyrin CreditAttribution: Zekvyrin commentedI had a similar error:
EntityMetadataWrapperException: Unable to get the data property data as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438 of .../profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
I got that error after trying to "go back" before completing the order and after the fee was applied.
Using latest commerce kickstart.
Comment #15
pyxio CreditAttribution: pyxio commentedI have the same problem. Did anybody solve this? Thanks!
Comment #16
lalbright CreditAttribution: lalbright commentedI have the exact same issue and am using Commerce 7.x-1.11, with Shiipping and Fees, and get the same errors at the same spot when selecting the shipping service. When I disable the Fees module, no errors in my recent errors log and no issue on the shipping service page while checking out. The rules I created with the Fees validate and actually work to add the correct Fee to the order, but not without the AJAX error. I've searched around the issue queue and linked around and don't really see any good leads. What's the status of this issue? Is there any information I can provide to help? Is there a good alternative to the Fee module to avoid this road block? This is a show stopper for my ecommerce site and I need a way to apply fees. If I were a developer I would debug and help myself, but I am not. :(
Comment #17
ramil g CreditAttribution: ramil g commentedlalbright,
I was having the same issue as you. I have Commerce Fees installed along with the shipping modules and Commerce Shipping Weight Tariff module and when switching between shipping services in the Shipping Service pane, an ajax callback occurs but I'd get an ajax error and it was because of an EntityMetadataWrapperException.
The problem has to do with Commerce Fees deleting the fee line items whenever a commerce_cart_order_refresh occurs. When the ajax callback happens it builds the form from the cache and all its data including $form_state which is where the order is typically stored. After doing a lot of debugging, I found out that there seems to be a mismatch between the two orders (the order stored in the $form_state and the actual cart order). The order in the $form_state still has the line item that Commerce Fees has deleted. So during the ajax callback when the order that contains the stale line item gets passed to contrib modules, some of the contrib modules(in my case it was Commerce Physical) loops through the order's line items and does a check for its type using an entity wrapper ($line_item_wrapper->type->value()) and it gets to that line item that doesn't exist anymore - thats when the Entity Wrapper Exception happens.
I wrote a patch for this and am attaching it here.
So basically what the module is doing right now is deleting any fee line items and then replacing it with a new one without checking if the two are the same which is not very efficient and is actually causing all this ajax errors. So this patch checks the existing fee line item and if it's exactly the same as the one being created and about to be added, then it doesn't delete the existing fee and instead just leaves it there and not add the new fee.
Comment #18
ramil g CreditAttribution: ramil g commentedIgnore the patch that I wrote above(#17). I just noticed that with that patch, if you have different conditions for applying a fee, let's say you have a fee for customers in the United States and you dont for custormers in Canada, if someone tries to checkout and selects US as their address and then goes back and changes the country to Canada, the fee that was applied does not get deleted.
The actual fix for this is actually this patch: https://www.drupal.org/node/1804592#comment-6575060
It solves the issue of the outdated $order object stored in $form_state.
Comment #19
munti CreditAttribution: munti commentedPatch #18 not working with address book