Rules + Features help (Rule is reverting with hook_default_rules_configuration but not saving)

Events happening in the community are now at Drupal community events on www.drupal.org.
dgtlmoon's picture

Hi all

I have a exported feature, and I've created a "mymodule.rules_defaults.inc" with the following (which I built by configuring the rule then exporting it)

function mymodule_default_rules_configuration() {
  $items = array();
  $items['get_quote_from_flatrate_8'] = entity_import('rules_config', '{ "get_quote_from_flatrate_8" : {
    "LABEL" : "UK Flat rate conditions",
    "PLUGIN" : "and",
    "REQUIRES" : [ "uc_order" ],
    "USES VARIABLES" : { "order" : { "label" : "Order", "type" : "uc_order" } },
    "AND" : [
      { "uc_order_condition_delivery_country" : { "order" : [ "order" ], "countries" : { "value" : { "826" : "826" } } } }
    ]
  }
}');

  return $items;
}

However, when I revert the feature, the rule in my {rules_config} never changes, it doesnt have any conditions added to it.

Any ideas? been stuck on this for a day or so, I can confirm the mymodule_default_rules_configuration is being called through the use of my breakpoint debugger, not sure what todo!

Comments

OK found the solution! Turns

dgtlmoon's picture

OK found the solution!

Turns out I had to increase the weight of the feature, even the rule default was being called it wasn't saving for some reason, increasing the weight seemed to have worked

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week