Closed (duplicate)
Project:
Rules
Version:
7.x-2.8
Component:
Rules Core
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2015 at 09:42 UTC
Updated:
19 Nov 2015 at 12:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
neorush commentedI can confirm this breaks pricing rules. It works fine in the cart. But as soon as you start the checkout process none of the rules are applied. This is with 7.x-2.8. Had to downgrade to 7.x-2.7 and everything is working fine again.
Comment #2
ivanhelguera commentedMy custom discount rule also stopped working. Downgrading to 2.7 made it start to work, though I think there might be still some glitches - the pricing rule used to be applied right after adding the products to the cart, now it seems it happens after entering the cart.
Contrary from what previous user claimed, for me the rule stopped working altogether, and it got back right after a downgrade. I had a rule using commerce extra rules conditions, and rewriting it for the newer Commerce Rules Extra did not change anything (yes. I did spend a couple of hours not knowing what's on)
Comment #3
adwuk commentedv2.8 breaks the pricing rules on my site too. Had to downgrade to 2.7 for the time being. Here are the rule details:
Comment #4
donkiely commentedSame problem here with breaking Drupal Commerce pricing rules. Rule is below, if that's of use.
Is there a way to downgrade without uninstalling Rules? We use rules quite extensively, and it would be a lot of work to rebuild the rules, besides the fact that a lot of our Commerce modules require Rules. I've not faced this kind of situation before. Worse comes to worse, I can revert to this morning's backup, but I've done a lot of work today.
Thanks!
Comment #5
adwuk commenteddonkiely, simply replace the rules module directory with 2.7. i don't believe there were any database schema updates between 2.7 and 2.8 so you should be fine. Don't forget to run the update script after though.
Comment #6
isilweo commentedHey,
the problem was introduced with patch from this #2324587: Rules might be triggered too early in the bootstrap. It breaks invocation of commerce pricing rules. It is little change in
Comment #7
roball commentedSame here. After updating the Rules module from 7.x-2.7 to 7.x-2.8, the checkout price from each cart was cleared to zero!
Reverting back to 7.x-2.7 solved the problem, so in 7.x-2.8 there is something badly broken when using together with Drupal Commerce.
Comment #8
thewilkybarkid commentedI'm not using Commerce but my rule broke too.
In my case the rule was being triggered through
mymodule_init, which happened to be called beforerules_initand sorules_event_invocation_enabled(TRUE)was not called.Comment #9
thewilkybarkid commentedThis patch fixes my problem, hopefully it solves the Commerce issue too.
(There might well be a better way that relying on the
hook_initorder though.)Comment #10
isilweo commentedAfter doing my own research I can confirm that it was broken because rules_init hook whas called to late. in my case 5 other functions fired rules_event_invocation_enabled before rules_event_invocation_enabled(TRUE). It worked in 2.7 of course because initialy $invocation_enabled was set to TRUE
Comment #11
dave bruns commentedJust confirming the rules 2.8 breaks product pricing rules on 2 commerce sites I manage as well. Like neorush, the behavior we see is that the discount works fine in the cart, but at checkout, it's no longer applied.
Downgrading to Rules 2.7 fixes the problem.
Comment #12
theodorosploumisConfirming that Rules 2.8 breaks product pricing rules on my commerce sites also.
Downgrading to Rules 2.7 solves the problem.
Comment #13
jmarr commentedWe lost about $3000 worth of orders in the two days it was failing. Downgrading solved the problem but I have to say this is really bush league amateur work.
Comment #14
IckZ commented@jmarr: Dont forget that drupal is free and community based! The actual rules problem is not nice but in general the real "amateur work" is the fact, that you did not test the checkout process after updating drupal or its modules. This should be done every single time after updating. We are all humans and mistakes happen. There is no 100% guarantee!
Otherwise you sould think about to switch to an agency which manage your shop. But this will cost a lot!
No harm meant!
Comment #15
fonant commentedComment #16
styrbaekI downgraded to Rules 2.7 and now my lineitems works again.
But my order total is still calculated with the default product price.
Comment #17
bojanz commentedMarking as critical since Commerce is broken. Reopened #2324587: Rules might be triggered too early in the bootstrap.
Comment #18
Channel Islander commentedI don't have any pricing rules in place but this bug makes Event "Select available payment methods" get evaluated, and its Rules get run, right at the start when adding a product to the cart.
Comment #19
greatmatter commentedIs there a chance this is impacting Commerce Discounts or Commerce Coupons? We started seeing some weirdness there at the same time as updating Rules to 2.8.
Comment #20
roball commentedIf you are using Drupal Commerce, you should definitely use Rules 7.x-2.7! 2.8 may break a lot of things.
Comment #21
anybodyI can confirm the problem for Drupal Commerce and this is truely critical. I was wondering a lot why strange things happened and checkout did not work correctly anymore.
Comment #22
roball commentedChanging title to make it clear Drupal Commerce won't work correctly anymore with Rules 7.x-2.8.
Comment #23
Channel Islander commentedI haven't been able to get this really fixed.
I downgraded to Rules 2.7 but I am still seeing the event "Select available payment methods" reacted to when I first add a product to the cart. I'm pretty sure that started with this upgrade to 2.8.
Would appreciate any reports of success or failure in rolling back to Rules 2.7.
EDIT: The rollback to 2.7 _did_ work .... I had another simultaneous problem.
Comment #24
anybodyFor me rolling back worked! Before no product could be added to cart.
Comment #25
stevetheboater commentedI rolled back to 2.7 having noticed a problem in the Select (or other) module for Commerce. I'm guessing this is part of the same issue but have raised an issue on there to be sure https://www.drupal.org/node/2405695
Comment #26
caw67 commentedrolling back worked! but thats cannot the solution itt hink
Comment #27
mduvergey commentedRolling back to Rules 7.x-2.7 fixed my price calculation issues.
Comment #28
w_a_mozart commentedNot sure if this helps you track down the problem, but I found that the rules were firing, but the result was being lost.
If I reload the line item entity from the cache by adding the following code in commerce_cart.module it seems to work.
So I'm not sure if its a Rules, Entity or Commerce issue.
Comment #29
slewazimuth commentedRolling back to Rules 7.x-2.7 fixed the issue I was having with tax calculations not showing up in the checkout display on a fresh site. I will therefore continue to use the 2.7 version of rules with commerce version 7.x-1.11 until things get resolved.
Comment #30
fagohm, a pity that was not discovered before release. Looks like no one tries drupal commerce with rules dev releases :-(
Comment #31
IckZ commented@fago: sure! I tested the dev on my test-server but I think nobody read this issue before the 2.8 release :(
Comment #32
fagooh, I see. I checked for criticals before the release, but sadly it wasn't critical then.
Comment #33
ccarrascal commentedSame problem here. Downgrading to rules version 2.7 solved my problem.
Comment #34
theorichel commentedI just upgraded to 2.8. Mistakes can always happen, but I cannot understand why this remains so for a month even without a warning on the available updates page or similar.
Comment #35
iwant2fly commented@TheoRichel The most likely reason that this remains is that almost all module maintainers do this on a volunteer basis. Most of them do not get paid to make updates to modules. Until a project they are personally working on need a feature or update or they have some free time, it likely won't get fixed. I have found that one of the fastest ways to get an issue solved if you are not able to do it yourself, is to message the module maintainers and offer a bounty to get the issue fixed. Depending on the severity it often doesn't take much. The developers that made this module and kindly posted it up here for all to use don't have a responsibility to make sure that every release works for every use case.
Also to fix your issue just downgrade to 2.7 and all should be good.
Comment #36
theorichel commentedAs to the volunteering part. I do not get paid for my Drupal work either. I am not a coder though, just a site builder. I appreciate the work that goes into programming, and that errors cannot be fixed that fast. But if the owner of some module discovers an error of this magnitude and doesnt even warn others then a lot of sympathy for the volunteering work is lost.
Indeed, as you say developers have no responsibility to make sure that every release works for every use case, but to use that argument when two of the most important Drupal modules apparently clash makes me wonder if you feel any responsibility at all.
Of course I have downgraded and it works again.
Comment #37
Leeteq commentedAgreeing with @TheoRichel, this issue needs to be mentioned on the project page.
Comment #38
summit commentedShouldn't 7.2.8 be moved away from the project page, so others do not have problems with this?
greetings, Martijn
Comment #39
Channel Islander commentedSetting version back to 2.8 ...don't know why @Leeteq changed it ???
Rules 2.8 WILL break your Drupal Commerce site.
Comment #40
guy_schneerson commentedLooks like setting
Fixed commerce rules for me so the patch at #6 should work for those who dont want to role back
Comment #41
Leeteq commented@Channel Islander; I assume the main development goes on in the -dev branch, therefore I changed it. Any special reason why it shouldnt be in -dev? (this issue already have the information in it that it is related to 2.8. That is not lost when shifting it to -dev.)
Comment #42
Channel Islander commented@Leeteq: If the issue is marked as being in the -dev branch, people will assume that the production release is not affected. But it is.
Comment #43
theorichel commentedIn my Modules page I still get prodded to upgared to 2.8 and when I click on the 'Release Notes' there still is no mention of this problem. Nor on the homepage. A quarter of a million users. Should we ask for a quote how much it costs to add this one line, after all it is an extra feature.
Comment #44
leducdubleuet commentedNot much useful payload here in the comments... :-|
Patch in comment #9 does not work for us here, taxes do not get calculated in Commerce.
I tested the proposed solution in comment #6 and mentionned in #40 and indeed it works, Commerce pricing rules get fired with Rules 2.8 and this "patch" :
rules.module line 1679 :
But I am not sure if we are looking for trouble making so?
It changes the logic of this function "rules_event_invocation_enabled" that was introduced in 2.8 exactly for that reason :
If we put TRUE, Rules invocation will be enabled by default instead...
@fago What is your take on this?
Thank you
Comment #45
Infillion commentedThanks @LeDucDuBleuet, I can confirm that this fixes the issue. I am using along with Commerce the Commerce Express Checkout (no order review) and Coupon 2.x. and all seems to work well now.
Comment #46
mxwitkowski commentedNice work here - thanks. I can also confirm that #44 enables Commerce Discount and Coupons to function again. Looks to be a duplicate/parallel discussion here: https://www.drupal.org/node/2324587
Comment #47
Channel Islander commentedYou're all very brave, hacking a module as complex as Rules and changing a piece of logic that you don't understand from True to False.
Myself, I would be worried that such a hack would have other, unforeseen consequences. Rules is used throughout my sites, not just by a Commerce sub-module or two!
It takes about 90 seconds to download Rules 2.7 and overwrite the 2.8 directory in the modules.
Here's one guy who will be waiting for a fix!
Comment #48
roball commented@47, and with such comments, you make it harder to get a fix.
Comment #49
Channel Islander commented@roball Actually I think that a fix is likely to be provided more quickly with accurate reports of errors, rather than guesswork. Changing code based on someone else's experimentation and applying it to a production site, and then declaring it fixed because your one symptom disappeared, is not very smart, and it doesn't provide good support to other users who come to this thread later. I'm just sharing advice learned over the years. But you are welcome to your opinion.
Comment #50
roball commentedThe solution on fixing the bug the right way is being discussed with this module's main developer at #2324587: Rules might be triggered too early in the bootstrap. It does not make much sense to fill this issue with endless comments, while the fixing process is already being in progress on the other issue.
Comment #51
mxwitkowski commentedAgreed that changing the logic is not a fix - rather a clue. The discussion on https://www.drupal.org/node/2324587 looks to have a good pathway to resolution by addressing the trigger point. Might want to have a look over there and join that discussion.
Comment #52
leducdubleuet commentedNobody said this was "Fixed". I personnaly tested putting $invocation_enabled to TRUE on a dev site and I am still using Rules 2.7 on all my production sites. I do not recommend anybody to put $invocation_enabled to TRUE by default on a production site. I did not provide a patch because I really don't think it is a good idea to blindly invert that logic without further looking into this.
That is why I was asking for the maintainer point of view on this...
Also, should we mark this bug as a duplicate of https://www.drupal.org/node/2324587 ?
Comment #53
ITWest-jg commentedNot sure if this commerce bug has been link to from here: https://www.drupal.org/node/2224019 adding a unit to the basket shows the price to be $1. Rolling Rules back to 2.7 fixes this. I assume it is the same issue.
Comment #54
Gleach commentedFollowing.
Downgrading for now seems to be a decent and working WORKAROUND.
Also patch here ( https://www.drupal.org/node/2324587#comment-9630729 ) seems to fix things for me.
Can anyone confirm this too, so we can middle us too in that post.
Comment #55
ledbelly2142 commentedRolling back to Rules 2.7 worked for me. Will look into the patch referenced node/2324587
Thanks for the pointer Gleach
Comment #56
mthomason commentedIf you are reading this, and you write software, wait until major versions to change system default values.
Don't want something in version 2.8 to be invoked the way it is in 2.7? Great! Wait until version 3!
Minor updates are not for changing core functionally.
Comment #57
sja1 commentedPatch mentioned by @gleach has been committed to rules project. #2324587: Rules might be triggered too early in the bootstrap
Comment #58
sja1 commented-
Comment #59
parisekI also confirm that latest build of Rules 7.x-2.x-dev resolved problems with rules not being fired during checkout process.
Closing as duplicate because committed patch is from other issue #2324587
Comment #60
rootworkJust wanted to clarify for anyone following this issue that the fix is in the new 7.x-2.9 release now.
Comment #61
xurizaemonI'm still seeing some discount rules evaluate but not take effect when testing with 7.x-2.9. Downgrading to 7.x-2.7 restores functionality. (Rule evaluates, but price total is not changed.)
Comment #62
torgospizzaWe're not having any issues at this time. @#61, do you see anything in the Rules debug log that might indicate why? I believe this issue was about Rules not firing, so if your issue is that the Rule is firing but the pricing isn't taking effect, that is probably a separate issue altogether.
Comment #63
Georg2791 commented#60 about updating from 2.8 to 2.9
are any database schema updates between 2.8 and 2.9 ??
so i just replace directory?
offcource i ll make a db and directory backup in any case
Thanks
Comment #64
ecvandenberg commentedDear George, it is a good practice to always run database updates after you update a module. Just make that a routine and you don't have to worry about it. And in stead of replacing the directory you could use the Drupal core update manager. That is much more easy. Or even better, use Drush...
Comment #65
kevster commentedJust to confirm that after an update to rules 2.9 this week I am seeing an issue with VAT (UK 20% sales tax) on commerce orders (latest commerce).
This only appears to affect customers who log in when going through checkout so anon checkouts are fine.
All appears fine in the order views - order view, order edit etc (commerce backoffice with quick view) but the payment sent to sagepay is minus the VAT element on the product sub total (shipping VAT is fine).
I will most prob roll back to 2.7 if I cant find another fix...