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.
The latest releases (2.4 & 2.5) of Rules breaks the 'Payment Method' configuration page. If you disable or enable any of the payment methods they disappear from the UI.
We have reproduced it on a fresh install with Commerce and Rules 2.5. Rolling Rules back to 2.3 resolved it.
Whilst it mentions Rules 2.3 on the project page, it does say that it works with the 'latest release'. It may break other sections, however we've only found this so far. We haven't found the source of this issue yet, as it took a while to track down what had caused it.
Comment | File | Size | Author |
---|---|---|---|
#5 | commerce-payment-rules-page-2093881-5.patch | 937 bytes | recrit |
Comments
Comment #1
Adam Wood CreditAttribution: Adam Wood commentedIt seems this isn't exclusive to Commerce. Any rule has this issue.
From the Rules issue queue: #1568134: Enabling or disabling a contrib rule makes it disappear
Should this be mentioned on the project page for reference until resolved in Rules?
Comment #2
rszrama CreditAttribution: rszrama commentedAhh, saw another issue about this a minute ago. Yeah, I can update the project page, but most people aren't going to see that before opening an issue. Best is just to leave this issue here open until it's resolved in Rules.
Comment #3
bojanz CreditAttribution: bojanz commentedWe'll have to hold-off a Kickstart release until this is resolved then: #2085059: Create a new Kickstart 7.x-1.x release.
Comment #4
fagoYeah, sry for that breakage. I just committed a fix - see #1568134: Enabling or disabling a contrib rule makes it disappear. Once it's verified it helps, I can roll another release to spread it.
Comment #5
recrit CreditAttribution: recrit commentedWith the fix at #1568134: Enabling or disabling a contrib rule makes it disappear, configured payment rules with owner = "commerce_payment" do not show.
The attached patch updates commerce_payment_ui_admin_page() to add a condition for
'owner' => array('rules, 'commerce_payment')
. This resolves the payment rules issue. I have not verified, but this could be an issue in other places where Commerce uses RulesPluginUI::overviewTable - checkout, pricing, etc.Comment #6
Adam Wood CreditAttribution: Adam Wood commentedPatch in #5 works for the payment module.
I forgot to check the other Commerce Rules pages in the end. The same issue exists on them.
Comment #7
rszrama CreditAttribution: rszrama commentedThere any way to avoid filtering by owner at all? If a user created a rule and then disabled it, wouldn't that mean it would disappear from the list, too?
Comment #8
fagoIf you don't take care of owner, it should just stay 'rules' and you should not have to care at all - i.e. it should work as before. However, this was broken for default-rules (see #1568134: Enabling or disabling a contrib rule makes it disappear) and that way owner became != rules in some cases.
The idea behind owner is that when you set it to "commerce" you want your rules to appear in the commerce Rules ui only, i.e. you filter on commerce then.
I figured we've no good recovery for people that ran into the problem yet though, thus I re-opened #1568134: Enabling or disabling a contrib rule makes it disappear for that.
Comment #9
krystlc CreditAttribution: krystlc commented#5 worked for me~
Comment #10
xbrianx CreditAttribution: xbrianx commentedWorks for me too!! Thanks
Comment #11
fagoI'd appreciate feedback on whether latest Rules 2.x-dev solves the problem, so we can roll a new tested release.
Comment #12
recrit CreditAttribution: recrit commentedThanks, the latest Rules 2.x (#18378b3) works for me. After the Rules update 7213, the payment method rules displayed correctly on the page and still showed after re-saving the rules.
Comment #13
rszrama CreditAttribution: rszrama commentedJust confirming that Rules 7.x-2.6 appears to be working fine for me, too. I'll update it in Kickstart 1.x along with Commerce 1.9 and the new Address Field release asap.