Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (line 339 of drupal/profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
I get this above error when I tried to create an order in the admin interface and trying to save it.
Edit: I'm also getting this same error on the admin/commerce/orders/carts page after updating to Kickstart 7.x-1.21.
Comment | File | Size | Author |
---|---|---|---|
#78 | commerce_discount-unknown-property-commerce-discounts-1872922-78.patch | 1.27 KB | Alex Bukach |
| |||
#55 | 1872922-55.patch | 6.69 KB | joelpittet |
| |||
#53 | 1872922-53.patch | 6.84 KB | joelpittet |
#49 | Schermafbeelding 2015-12-30 om 13.36.33.png | 192.92 KB | drupbasic |
#40 | Schermafbeelding 2015-12-04 om 11.08.46.png | 47.72 KB | drupbasic |
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedHm, that's problematic.
Try disabling commerce_discount until we can look into this.
Comment #2
jsacksick CreditAttribution: jsacksick commentedI just tried to create an order and saved it I wasn't able to reproduce the bug, I created an order and I tried with/without a discount and it worked.
Comment #3
Deciphered CreditAttribution: Deciphered commentedI have also reproduced this issue, however i don't currently have time to debug or write reproduction steps as I'm on the clock for a client trying to prototype something else. I will try to come back to this issue at another stage but no guarantees.
Comment #4
gstone007 CreditAttribution: gstone007 commentedI have this same error but it is generated during execution of a Rule during cron run. The Rule creates a new Commerce Order and then saves it. It might be valuable information to know that the Rule in questions is the "Generate Recurring Orders" from the latest dev version of the Commerce Recurring module.
Comment #5
vasikethis looks like duplicate (a report) of this Commerce Discount issue #1835528: commerce_discount_usage_commerce_order_insert function crash others module using bundle of commerce_order entity type..
which was already fixed and its solution included in Commerce kickstart (Commerce Discount upgrades).
Comment #6
jenlamptonI'm getting this same error on the admin/commerce/orders/carts page after updating to Kickstart 7.x-1.21.
I'm running the 7.x-1.0-alpha3 version of commerce_discount, which was released long after that patch was committed.
Since the only difference between the view at admin/commerce/orders/carts and admin/commerce/orders is the status of the order, I tried toggling the statuses and the only times the error appears is when the status is either "cart" or "checkout". In both cases the error is generated.
The view seems to work fine on the live site, but when the database is exported and brought into a dev environment, everything goes haywire. I'm not sure what discount line items may have to do with active sessions, but that may be the root of the problem.
I expect this may be something to do with the way commerce discount line items behave when they are in the cart, or checkout.
Comment #7
cassandra04 CreditAttribution: cassandra04 commentedHi, I am also getting this error when using commerce kickstart with commerce_marketplace module. I am using the latest version. Does anyone know how to fix it?
Comment #8
murinello CreditAttribution: murinello commentedHi,
I'm getting the same error in line 335 with Kickstart 7.x-2.12 after enable Commerce Marketplace Order 7.x-1.0-beta2
Comment #9
juaninf CreditAttribution: juaninf commentedHi,
I'm getting the same error EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (line 335 of /var/www/turegalo/profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
when I'm trying to access mange order.
thanks
Comment #10
lsolesen CreditAttribution: lsolesen commented@PedroVale @juaninf @cassandra04 Could you please supply the exact steps to reproduced on CK 2.x?
Comment #11
lsolesen CreditAttribution: lsolesen commentedGuessing that this has been fixed by now, since there is no activity. If it is still an issue, please reopen with exact steps to reproduce.
Comment #12
andyg5000See #2285199: Add support for multiple order types
Comment #13
Chithra K CreditAttribution: Chithra K at Zyxware Technologies commentedI am getting the same error when I access the "All products" page. I have commerce_marketplace(7.x-1.0-beta2) and eck(7.x-2.0-rc2) enabled.
I am using a fresh installation of kickstart .The only thing I did in the site is enabling the above modules and added a sample product. I haven't added any of the categories.
Comment #14
lsolesen CreditAttribution: lsolesen commentedComment #15
andyg5000@chitz07 did you try the patch in the issue from comment 12? If not please do. If so please update with more info.
Comment #16
Chithra K CreditAttribution: Chithra K commentedI did try the patch, but unfortunately that didn't work. I am still getting the error
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (line 335 of /../commerce_kickstart-7.x-2.15/profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).
when I try accessing the pages.
Comment #17
andyg5000Hey @chitz07, turns out there are multiple places in commerce discount where the commerce_discounts wrapper property is accessed without being checked. I've updated the patch to do this check each time.
https://www.drupal.org/node/2285199#comment-8953643
Can you review the new patch and see if it fixes your issue? If not, would you mind backtracing line 335 of the entity metadata wrapper to determine what function is calling *wrapper*->commerce_discounts?
I guess this issue should stay open until the commerce_discount module is patched and the update is included in the next Kickstart release.
Comment #18
themic8 CreditAttribution: themic8 commentedandyg5000,
I have tried the patch and this issue is still there.
I'm on Commerce Kickstart 7.x-2.14
Comment #19
andyg5000Hey @themic8, I've noticed that there are issues with commerce_coupon and commerce_discounts that can cause this. They both have very similar error messages because they're both related to the same exception. This should be fixed by downloading the latest -dev versions of commerce_discounts and commerce_coupons. Let me know if you're still having problems. It may require that we backtrace the error to see where the call is actually coming from.
Comment #20
themic8 CreditAttribution: themic8 commented@andyg5000, I have updated both to the latest dev and now I am receiving this error: Unknown data property commerce_discounts
I also have commerce marketplace installed.
Comment #21
themic8 CreditAttribution: themic8 commented@andyg5000, I have disabled the marketplace module, made sure I was using both the latest dev versions of commerce_coupon and commerce_discount. This error does not appear anymore.
Comment #22
lsolesen CreditAttribution: lsolesen commented@andyg5000 Are you able to reproduce this on the latest dev of Kickstart? Could you supply the exact steps, it would be very helpful.
Comment #23
mglamanLooks like a bug in Commerce Discount. There's been a lot of work done, so I'm sure this could probably get closed.
Comment #24
joelpittetClosing this, if someone can provide a scenario to reproduce this. Feel free to reopen or create a new issue.
Comment #25
wqmeng CreditAttribution: wqmeng commentedStill get this error.
Message EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (line 335 of /home/www/xxx.com/sites/all/modules/entity/includes/entity.wrapper.inc).
Comment #26
wqmeng CreditAttribution: wqmeng commentedComment #27
joelpittet@wqmeng can you put a watchdog() message in entity.wrapper.inc on that line 335 and get a backtrace from that error so we at least know which function is asking for that property? That would really help narrow down the problem.
Comment #28
joelpittetActually #27 would be helpful, but here is a general entity_metadata_wrapper cleanup. There are a couple suspect checks in the wrong order or using the wrong type of check for entity metadata wrappers and this may help.
If you can reproduce these error, it would help to try this patch too.
Comment #30
joelpittetTypo in that last one.
Comment #31
wqmeng CreditAttribution: wqmeng commentedHello joelpittet,
I added the patch, but still get error of this, so that I finally find the problem also exist in the module commerce_coupon .
Here is what I changed.
/all/modules/commerce_coupon/commerce_coupon.module
function commerce_coupon_order_discount_ids($order) {
Comment #32
joelpittet@wqmeng Can you open up an issue in commerce_coupon so the issue is tracked there and post the link here?
Comment #34
joelpittetI've committed #30 because in some cases it could solve a problem with EMW and others it just brings consistency for how the magic methods are used. The other two cases that are particularly bad are
empty()
doesn't work with EMW and the other one theisset()
check is second after it's already tried to get thevalue()
of it.Comment #35
joelpittetI'll postpone this for a couple of weeks and if someone sees this with head and not commerce_coupon related then feel free to re-open.
If you can reproduce this error, try to get a stack trace because that would help a ton to solve this.
Comment #36
oystercrackher CreditAttribution: oystercrackher commentedHello, I am also getting this error after creating a coupon within a discount. Here is the error message and stack trace info:
Please advise on any suggestions.
Thanks
exception 'EntityMetadataWrapperException' with message 'Unknown data property commerce_discount_offer.' in /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/includes/entity.wrapper.inc:335
Stack trace:
#0 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/includes/entity.wrapper.inc(392): EntityStructureWrapper->getPropertyInfo('commerce_discou...')
#1 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/includes/entity.wrapper.inc(413): EntityStructureWrapper->get('commerce_discou...')
#2 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/commerce_discount/includes/commerce_discount.controller.inc(65): EntityStructureWrapper->__get('commerce_discou...')
#3 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/includes/entity.inc(215): CommerceDiscountControllerExportable->save(Object(CommerceDiscount))
#4 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/entity.module(283): Entity->save()
#5 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/entity.module(942): entity_save('commerce_discou...', Object(CommerceDiscount))
#6 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/entity/entity.module(853): _entity_defaults_rebuild('commerce_discou...')
#7 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/commerce_shipping/commerce_shipping.module(177): entity_defaults_rebuild()
#8 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/commerce_shipping/commerce_shipping.module(153): _commerce_shipping_default_rules_reset(Array)
#9 [internal function]: commerce_shipping_modules_enabled(Array)
#10 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/includes/module.inc(895): call_user_func_array('commerce_shippi...', Array)
#11 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/includes/module.inc(499): module_invoke_all('modules_enabled', Array)
#12 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/features.module(649): module_enable(Array)
#13 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/includes/features.features.inc(70): features_install_modules(Array)
#14 [internal function]: dependencies_features_rebuild('sdtn_base_comme...', 'dependencies')
#15 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/features.module(594): call_user_func_array('dependencies_fe...', Array)
#16 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/features.module(998): features_invoke('dependencies', 'features_rebuil...', 'sdtn_base_comme...')
#17 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/features.module(1026): _features_restore('rebuild', Array)
#18 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/sites/all/modules/contrib/features/features.module(275): features_rebuild()
#19 [internal function]: features_flush_caches()
#20 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/includes/module.inc(895): call_user_func_array('features_flush_...', Array)
#21 /data/disk/o4945186064/static/jgd-prod5.15-core-v7.39-om8/drupal-7.x/includes/common.inc(7796): module_invoke_all('flush_caches')
#22 /data/disk/o4945186064/tools/drush/commands/core/drupal/cache.inc(99): drupal_flush_all_caches()
#23 /data/disk/o4945186064/tools/drush/includes/drush.inc(707): drush_cache_clear_both()
#24 /data/disk/o4945186064/tools/drush/includes/drush.inc(694): drush_call_user_func_array('drush_cache_cle...', Array)
#25 /data/disk/o4945186064/tools/drush/commands/core/cache.drush.inc(143): drush_op('drush_cache_cle...')
#26 [internal function]: drush_cache_command_clear('all')
#27 /data/disk/o4945186064/tools/drush/includes/command.inc(368): call_user_func_array('drush_cache_com...', Array)
#28 /data/disk/o4945186064/tools/drush/includes/command.inc(219): _drush_invoke_hooks(Array, Array)
#29 [internal function]: drush_command('all')
#30 /data/disk/o4945186064/tools/drush/includes/command.inc(187): call_user_func_array('drush_command', Array)
#31 /data/disk/o4945186064/tools/drush/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#32 /data/disk/o4945186064/tools/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#33 /data/disk/o4945186064/tools/drush/drush.php(11): drush_main()
#34 {main}
Comment #37
oystercrackher CreditAttribution: oystercrackher commentedComment #38
joelpittetThat is a different error, can you open up a new issue. A scan of the call stack (which is very helpful btw, thanks)
Shows that features is rebuilding and it looks like commerce_shipping is involved it exporting a discount.
Please provide version numbers for those modules and steps to reproduce if possible.
The discount export would be helpful as well if you have it
Comment #39
joelpittetAlso looks like drush is involved...
Comment #40
drupbasic CreditAttribution: drupbasic commentedHi,
I am using discount 7x-1.0.alpha 7 and also getting this error. Even with all coupon modules switched off. Because of this error I cannot change the status from orders beyond the 'payment' point. So cannot set them to completed. Which means there's a lot of things not being 'triggered' such as email confirmation to client etc...
I really do need the discount module to enable free shipping (without a coupon) for all order above a certain total amount.
Should I install the dev version on a production site?
Error msg in screenshot.
Thx
Comment #41
ben van den broeck CreditAttribution: ben van den broeck commentedI also got this error, even when using the latest dev. It started on updating to alpha7 version of commerce_discount. The patch was not working for me. The only solution was to place back a back-up.
Comment #42
joelpittet@drupbasic does the -dev version fix the problem? (aka download the production database locally to see if dev will fix it). If so I'll gladly make another alpha release.
Comment #43
joelpittet@ben van den broeck With -dev you run into this problem? Are you using coupon?
There is no place in the code base in -dev right now that is trying to access that property without first checking it exists so a debug_backtrace() from where you are both getting that error from would really help track down the culprit
Comment #44
mglamanSo... Shouldn't that property always be available unless the wrapper has an empty order? The discount module requires that field.
Comment #45
andyg5000We should make it a standard to wrap these in try catch and handle the exceptuons properly. Making assumptions that all bundles will always have these properties continues to bite us in the ars in all of commerce contrib :)
I'm happy to review these next week but and taking a screen break this weekend!
Comment #46
joelpittet@andyg5000 if we had to try catch every use of a EMW property "properly" I'm quite sure the codebase would nearly double without huge benefit. We need to make reasonable assumptions about our EMW objects. I already am checking the existence of that property in the issue summary in all places in our codebase. If we 'expect' there are situations where this property doesn't exist and it must exist, try catch would be a good idea. I'd really like to know where people are running into that, and a backtrace would really help point this out.
As it is right now I highly doubt this exception is related to commerce_discount due to the checks I've committed so re-postponing until someone provides a backtrace proving otherwise.
Comment #47
drupbasic CreditAttribution: drupbasic commentedAs a follow up to #40: after some tryouts on my local website (thx acquia dev desktop!) I got rid of the error. I kept the alpha 7 release but I completely removed the 'sub' module 'usage' of Drupal discount. So not just disabled it but also removed it, cleared cache, PHP update... until the 'maximum usage' field did no longer appear on the add discount screen. That fixed the error for me and the discount module still works for free shipping on all orders above a certain amount, as I wanted. Hope this helps. I have the discount_coupon module switched off. Now I have to figure out a way to get the coupon module to work without getting new errors.
UPDATE:
found that when I added a second discount. 10% off all products - no coupon module installed the entity wrapper error appeared again. So even without the usage module active the discount module only works for one discount.
Comment #48
mglamandrupbasic thanks! In -dev usage was merged into the main module. Since you can reproduce, could you give it a try to see if it still exists? If it does, then we can dive into the code and figure out what is happening!
Comment #49
drupbasic CreditAttribution: drupbasic commentedHi
Did my homework :-)
Installed the -dev version of commerce discount. Still with coupon module not installed and I'm sorry to tell it does not work. Even with just one discount active when finishing the order (so after selecting payment) the entity wrapper error appears. So the dev version is actually a step backwards for me as the alpha version works for 1 discount when I remove the usage module. Added a screenshot of the only active discount. Will try other discount types and see if -dev version of module works. Let me know if you need additional info.
UPDATE:
tried % off total order amount: didn't work
tried fixed amount off total order amount: didn't work either
here's the error line again that appears with whichever discount I create:
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (regel 335 van /Users/Kim/Sites/devdesktop/sites/all/modules/entity/includes/entity.wrapper.inc).
Would be happy to do the backtrack if that's useful but don't have a clue how to do that, so I would need instructions for that.
Comment #50
drupbasic CreditAttribution: drupbasic commentedCan Anyone write this watchdog code for me and tell me were to paste it? I would be happy to provide you with the output in order to fix this error.
Comment #51
joelpittet@drupbasic thanks for providing more information. I think someone on IRC was having a similar issue and had some sort of reproducible scenario that I'm hoping he will post here.
Re #50 Paste this right above the line that throws the exception.
http://dropbucket.org/node/7043
Comment #52
joelpittet@drupbasic Are you using https://www.drupal.org/project/commerce_entitycache?
Comment #53
joelpittetOk I looked closely at the access to the data property retrieval and replaced all (except for tests) with
commerce_price_wrapper_value()
which will also default the['data']['components']
array which were are usually after.If this passes test, please test this patch resolves the issue.
Comment #55
joelpittetWas a couple typos.
Comment #56
joelpittetComment #57
mglamanShouldn't we still check if the line item exists here?
Comment #58
mglamanNevermind, this only gets called in
commerce_discount_usage_record_order_usage()
which is invoked on insert and update, so no chance of line item being moot.Comment #59
joelpittetNot sure what would be a better check there. The line item wrapper is NULL or a metadata wrapper. And I think it's null when commerce_entitycache goes weird. (or entity controller cache, hasn't been resolved).
The isset on the property I think will cover both cases in one shot better... I think anyway...
Comment #61
joelpittetI've committed the patch in #55. I'm a bit fearful of marking this fixed. But please try the latest -dev release. And if you are still running into this, hunt me down and we'll get to the bottom of this.
Comment #62
timbraeckman CreditAttribution: timbraeckman commentedHi joel,
I installed the latest dev version and now it works again.
Last time i got it to work too but when there was a new order, it suddenly wasn't possible to edit orders anymore again.
Keep you posted man!
grts
Comment #63
timbraeckman CreditAttribution: timbraeckman commentedHaving the same problem again!
Problem with editing orders is still there when i have a discount rule based on role. It always works perfect, until someone buys something in our store and a user is created with rules. I disabled the discount module again because i couldn't edit my orders anymore again.
Hope we can find a fix for this so i can start giving discounts to my friends! :)
Comment #64
joelpittet@timbraeckman can you try my snippet in #51 to get a backtrace in watchdog on the error?
Comment #65
timbraeckman CreditAttribution: timbraeckman commentedI enabled the discount module again so my discount is back but i don't get the error anymore when editing an order. So perhaps it will occur again when i get a new order in my shop and than it will throw the error everytime for each order edit. Very weird!!
Comment #66
timbraeckman CreditAttribution: timbraeckman commentedI get this error now:
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (regel 335 van /data/sites/web/tresorabe/www/sites/all/modules/entity/includes/entity.wrapper.inc).
But only when i change the status of an order with an owner (user) to "Bezig". When i change to "Voltooid" (completed) it doesn't throw this error...
If it's an order with anonymous user i can change to any order status...
backtrace didn't put anything in logs :(
Comment #67
andyg5000@timbraekman, can you way in on #2661530: New critical EntityMetadataWrapperException I feel that should solve your problem.
Updated: Thank you Erik!
Comment #68
torgosPizzaI think Andy meant #2661530: New critical EntityMetadataWrapperException
Comment #70
timbraeckman CreditAttribution: timbraeckman commentedJoel i finally have a local copy of my website and added backtrace to all errors of my website.
I only keep getting this critical error when changing the status of an order to "Bezig" (busy in english) when there is a discount on the order.
Here is the backtrace:
Comment #71
timbraeckman CreditAttribution: timbraeckman commentedComment #72
VaithianathanV CreditAttribution: VaithianathanV at Kiluvai Tech Solutions Private Limited commentedI am getting the following error when the commerce marketplace order, commerce discounts and commerce coupons modules are enabled. I am not getting error when only commerce discounts and commerce coupons are enabled.
The error is as follows.
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (line 335 of /var/www/html/test/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).
On backtracing the error line i am getting the following output.
[
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/entity\/includes\/entity.wrapper.inc",
"line": 395,
"function": "getPropertyInfo",
"class": "EntityStructureWrapper",
"object": {
},
"type": "->"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/entity\/includes\/entity.wrapper.inc",
"line": 416,
"function": "get",
"class": "EntityStructureWrapper",
"object": {
},
"type": "->"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce_coupon\/commerce_coupon.module",
"line": 1240,
"function": "__get",
"class": "EntityStructureWrapper",
"object": {
},
"type": "->"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce_coupon\/commerce_coupon.module",
"line": 1161,
"function": "commerce_coupon_order_discount_ids"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce_coupon\/commerce_coupon.module",
"line": 1360,
"function": "commerce_coupon_order_coupon_code_discounts"
},
{
"function": "commerce_coupon_commerce_cart_order_refresh"
},
{
"file": "\/var\/www\/html\/test\/includes\/module.inc",
"line": 951,
"function": "call_user_func_array"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce\/modules\/cart\/commerce_cart.module",
"line": 1146,
"function": "module_invoke_all"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce_coupon\/includes\/commerce_coupon.checkout_pane.inc",
"line": 90,
"function": "commerce_cart_order_refresh"
},
{
"file": "\/var\/www\/html\/test\/sites\/all\/modules\/contrib\/commerce\/modules\/checkout\/includes\/commerce_checkout.pages.inc",
"line": 107,
"function": "commerce_coupon_pane_checkout_form"
},
{
"function": "commerce_checkout_form"
},
{
"file": "\/var\/www\/html\/test\/includes\/form.inc",
"line": 841,
"function": "call_user_func_array"
},
{
"file": "\/var\/www\/html\/test\/includes\/form.inc",
"line": 464,
"function": "drupal_retrieve_form"
},
{
"file": "\/var\/www\/html\/test\/includes\/form.inc",
"line": 973,
"function": "drupal_rebuild_form"
},
{
"file": "\/var\/www\/html\/test\/includes\/ajax.inc",
"line": 386,
"function": "drupal_process_form"
},
{
"function": "ajax_form_callback"
},
{
"file": "\/var\/www\/html\/test\/includes\/menu.inc",
"line": 527,
"function": "call_user_func_array"
},
{
"file": "\/var\/www\/html\/test\/index.php",
"line": 21,
"function": "menu_execute_active_handler"
}
]
Comment #73
joelpittet@VaithianathanVLooks like that may be in this function from your callstack:
commerce_coupon_order_discount_ids
Which is maybe a bug in
commerce_coupon
.Comment #74
ThirstySix CreditAttribution: ThirstySix as a volunteer commentedI am using Commerce_marketplace module. Discount type "Product discount" is working correctly. but, Discount type "Order discount" not working..
$order_discount_ids are not set in the commerce_coupon_order_discount_ids($order) function.. Because, Line item type "commerce_discount" is not added in the order type. How can we set the commerce_discount line item in the order?
Thanks in advance.
Comment #75
ThirstySix CreditAttribution: ThirstySix as a volunteer commentedWorking perfectly. https://www.drupal.org/node/2301043#comment-8961021
Thanks Andy.
Comment #76
drupbasic CreditAttribution: drupbasic commentedHi, hate to re-open this but the problem persists. As I update my drupal commerce, the discount module was update to alpha 8 and I had the same problems again. See #40 and also #66 seems to have same problem.
The error prevent the shopping cart from getting from 'payment' to 'waiting. So the discount is applied correctly but causes the checkout to fail to complete. Although the customer can proceed to the review page, complete the payment but at the end (where the cart should be updated to 'waiting') this error appears instead of 'thank you for order XXX etc...' :
EntityMetadataWrapperException: Unknown data property commerce_discounts. in EntityStructureWrapper->getPropertyInfo() (regel 335 van /Applications/MAMP/htdocs/WOLWERELD/sites/all/modules/entity/includes/entity.wrapper.inc).
This is the discount that I have created:
Type: order discount
Conditions: Total amount product exceeds X EUR
Offer type: FREE SHIPPING
Shipping service : X
Compatible with all
Free shipping discount strategy: discount all other shipping services by the same amount as the selected shipping service
The error ONLY appears when all of these conditions are met:
-the user in an anonymous user
-the user selects shipping service X
So the error does not appear when the user is logged in or when shipping service Y or Z are choosen. The discount is applied correctly to all the shipping services so this works.
I did try to paste the backtrace snipped above the line that throws the error but then website doesn't start anymore. So no backtrace yet.
Solution: uninstall alpha 8, install alpha 7, delete the submodule 'usage' and the error doesn't appear anymore.
Would love to be able to use alpha 8 and the coupon module so if you can reproduce and find a fix that would be great.
Comment #77
drupbasic CreditAttribution: drupbasic commentedCan you re-open this?
Comment #78
Alex Bukach CreditAttribution: Alex Bukach commentedIn my case the issue persisted, and it was caused by the fact that the
commerce_discounts
field was created only for the default commerce order bundle, why I use another bundle. Here's the patch. Should I create another issue for that?Comment #79
jsacksick CreditAttribution: jsacksick commentedComment #81
jsacksick CreditAttribution: jsacksick at Centarro commented@Alex Bukach: Committed your patch.