Thank you for maintaining this great module.
On a fresh install, I can make some discounts work, but I've got a bunch of ajax arrors when I try to put some conditions from the GUI :
with an order discount type, only the condition "products and quantity" works :
- trying to add a condition "Total", I get Ajax error : ResponseText : Notice : Undefined index: total in commerce_order_compare_order_amount_configure() (line 194 of ... inline_conditions.inline_conditions.inc
- almost the same, trying to add a condition "User" : ResponseText : Notice : Undefined index: account in commerce_order_has_owner_configure() (line 224
- again for condition products : ResponseText : Notice : Undefined index: products in commerce_order_contains_products_configure() (line 302 ) but once from time to time if I insist playing with the list I can get the field where to enter product name...
With a product discount type :
- trying to add a condition Product(s), returns ResponseText : Notice : Undefined index: sku in commerce_product_contains_products_configure() (line 442...
This occurs on a Commerce install (not Kickstart).
Core 7.24
Commerce 7.x-1.8
Inline Conditions I tried both with 7.x-1.0-alpha4 and 7.x-1.0-alpha3+10-dev
Commerce Discount I tried both with 7.x-1.0-alpha4 and the last dev :-(
Thanks for your attention !
Comments
Comment #1
Kojo Unsui commentedComment #2
Kojo Unsui commentedAny help would be really welcome, please. I'm currently blocked with this behaviour.
Thanks in advance.
Comment #3
ralt commentedHi,
We need something to be able to reproduce. I just tried right away and it worked like a charm.
Could you try restarting from an empty drupal?
Cheers,
Comment #4
ralt commentedComment #5
Kojo Unsui commentedThanks for your reply.
Of course I have no doubt that it works like a charm on a fresh install. Unfortunately, My project is quite advanced now & I can't disable "some" modules or whatever because it's a huge project and would take me a month just to test. This is why I need to solve the bug within that project... :-(
Comment #6
goz commentedOn a development site which reproduce this error, try to remove all current checkouts before making your discounts.
Like Ralt says, it's hard to fix something we cannot reproduce.
Comment #7
ralt commentedMy bad! I actually reproduce on a clean environment. It was just correctly watchlogged.
WARNING: the patch has to be applied to the inline_conditions module.
@Kojo: check your PHP settings (specifically, display_errors) for an immediate fix. If you can, apply the attached patch.
If one prefers to cherry-pick the commit, here it is: https://github.com/Ralt/inline_conditions/commit/e19015a09d97cd710771c24...
However, the fix must be applied before #2244969, and #2244969 will have to be re-rolled. Or the other way around, manually applying the fix isn't very long.
Comment #8
Kojo Unsui commentedGreat thanks ! It is true that I will turn off notices on production...
Meanwhile, I got lost between different versions / patches, so would that be correct setup please? This is what I've done :
commerce_discount.inline_conditions.incwith #7, since the conditions were moved frominline_conditions.inline_conditions.incto this fileI removed also all current checkouts before making new discounts (and of course cleared one million times cache). However, notices remained. Buh !
Comment #9
ralt commented@Kojo still the same notices? I'd guess not, since they at least changed files. Can you paste the new ones?
Comment #10
ralt commented@Kojo still the same notices? I'd guess not, since they at least changed files. Can you paste the new ones?
Comment #11
Kojo Unsui commentedIndeed. I'm going to check again in half an hour about. Meanwhile can you confirm I made the right things with versions/patches ?
Comment #12
Kojo Unsui commentedThe notices were changed, taking in consideration conditions were moved from Inline conditions to Commerce discount : Notice : Undefined index: total dans commerce_order_compare_order_amount_configure() (line 190 of ... commerce_discount\commerce_discount.inline_conditions.inc) but the notices remain the same.
Some
dsm()below :commerce_order_compare_order_amount_configure($settings) { dsm($settings);returns
... (Array, 0 elements)and the notice is Undefined index: total in commerce_order_compare_order_amount_configure() (line 190
function commerce_order_contains_products_configure($settings) { dsm($settings);returns
and the notice is Undefined index: products in commerce_order_contains_products_configure() (line 304
function commerce_order_has_owner_configure($settings) { dsm($settings);returns
and the notice is Undefined index: account in commerce_order_has_owner_configure() (line 226
Thanks
Comment #13
ralt commented@Kojo the patch should be applied without taking care of the other patches. Don't bother about them.
Comment #14
Kojo Unsui commented@Ralt yes I applied the patch. Please read my last post since I cannot be more precise: the problem is
$settingsnever contains what it is expected to. I didn't dig more into the code to check why because I'm desperately timeless. CheersComment #15
Kojo Unsui commentedups posted twice :(
Comment #16
ralt commented@Kojo can you show me the patched code? It seems the patch wasn't applied. Just the *_order_amount_configure function.
Comment #17
Kojo Unsui commented@Ralt sorry I've been ill a few days. Here it is. AFAIK yes it was applied.
Comment #18
ralt commented@Kojo ugh... it should be isset(), not !isset(). My bad.
Comment #19
Kojo Unsui commentedIndeed, I should have noticed myself :(.
OK for first notice. What about the three other ones please ?
Thanks again.
Comment #20
ralt commentedRerolled the patch and added all the notices left.
Comment #21
Kojo Unsui commentedGreat, thanks. Tested. This notice is remaining :
With a product discount type : trying to add a condition Product(s), returns ResponseText : Notice : Undefined index: sku in commerce_product_contains_products_configure() (line 442...
Last, people who jumped to 7.x-1.0-alpha4+3-dev and already :
will need the same patch for
commerce_discount.inline_conditions.incComment #22
ralt commentedAnd here goes the last reroll :) Thanks for testing!
Comment #23
Kojo Unsui commentedOups Ralt, forgive me I had to solve some sysadmin emergencies and forgot that issue. Tested & fine of course. Merry Christmas !
Comment #24
ralt commentedMarking as RTBC on behalf of @Kojo.
Comment #25
joelpittetThis patch doesn't apply to this project, moving. Hope that's ok with you?
Comment #26
Kojo Unsui commentedThat's fine, thanks.
Comment #27
jkuma commentedSince we have moved the inline conditions to discount module (see #2129997: Remove discount inline conditions), this patch is no longer applying to dev branch. I'm moving it to its proper place.
Comment #28
jkuma commentedComment #29
joelpittetI think what @das-peter did in #2244969-5: Add inline conditions from inline_conditions into module. with the unions covers at least half of what this patch was trying to do.
Comment #30
mglamanRerolled against latest -dev
Comment #31
joelpittetTried to get these errors with the latests dev, was unable to reproduce. Please re-open and add the Steps to reproduce to the Issue summary.
(tried to upload an animated gif showing but it was really big, so here's a screenshot)