0

I need to clone and modify the following rule:

commerce_checkout_order_email

However, it does not appear in the UI.

I have checked the following paths with no success:

admin/config/workflow/rules
admin/commerce/config/checkout/rules

I'm obviously missing something but I can't figure it out.

This rule is defined in this file along with 4 other rules, all of which do appear in the UI

sites/all/modules/commerce/modules/checkout/commerce_checkout.rules_defaults.inc

The thing is this rule DOES get executed properly.

Any ideas will be greatly appreciated.

By the way, I have doubled checked on TWO different drupal installations, one of which is a default commerce_kickstart distribution and the rule doesn't appear either. It won't show up in the UI nor in the database.

1
  • I don't think it's possible to delete this Rule. Even if you delete it from the database directly, it is recreated the first time Commerce gets called (because it's in the defaults .inc file).
  • Are you sure it's not just disabled?
  • Your module directory structure is non-standard; Commerce should be in sites/all/modules/contrib.

Here's a copy of the Rule in case you need to import it again:

{ "commerce_checkout_order_email" : {
"LABEL" : "Send an order notification e-mail",
"PLUGIN" : "reaction rule",
"WEIGHT" : "4",
"OWNER" : "rules",
"TAGS" : [ "Commerce Checkout" ],
"REQUIRES" : [ "rules", "commerce_checkout" ],
"ON" : { "commerce_checkout_complete" : [  ] },
"DO" : [
  { "mail" : {
      "to" : [ "commerce-order:mail" ],
      "subject" : "Order [commerce-order:order-number] at [site:name]",
      "message" : "Thanks for your order [commerce-order:order-number] at [site:name].\u000A\u000AIf this is your first order with us, you will receive a separate e-mail with login instructions. You can view your order history with us at any time by logging into our website at:\u000A\u000A[site:login-url]\u000A\u000AYou can find the status of your current order at:\u000A\u000A[commerce-order:customer-url]\u000A\u000APlease contact us if you have any questions about your order.",
      "from" : ""
        }
      }
    ]
  }
}
  • I don't really want to delete the rule, simply disable it and clone it to customize it to my needs. Problem is it doesn't even appear in the rules_config database table... – bmunslow Jan 26 '15 at 10:26
  • well that is a mystery. Did you try importing the Rule I posted here? – Channel Islander Jan 26 '15 at 11:30
  • I did and it actually got imported – bmunslow Jan 26 '15 at 11:42
1

Some time ago i had similar problem. The problem was (i think it was a bug of rules) that when saving a rule sometimes its owner was changed to something else and after that i could not see it in the ui

So check in the data base the table rules_config, search the rule a check its owner, it should be rules

  • Thanks for checking! Interestingly enough, this rule does NOT appear in the rules_config table! However, it DOES get executed. Strange! – bmunslow Jan 26 '15 at 10:23
  • 1
    Are you sure that rule is the one being executed? Because if it not in rules_config then it is very very very strange i would say lol (maybe something cache related?). I just check my table and i have it, disabled but it is there. Maybe in your site the rule got deleted by error? There are some others rules sending emails? – Gianni Di Falco Jan 26 '15 at 10:54
0

After lots of research, and thanks to some helpful hints posted by other users here, I have been able to trace out the problem to the following:

  • The rule was indeed working properly throughout my testing process
  • The rule MUST have been deleted when disabling a 3rd party module. Possibly one of the following: i18n, i18n_string, rules_i18n (I disabled them and I did get a warning saying some rules had been translated and would be affected)
  • After disabling these modules, the rule wasn't working anymore (I thought it was since I hadn't tested it yet after disabling those modules
  • Importing it again get it back up and running

Thank you all for you help and cooperation!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.