You are here

function rules_rule_format_upgrade in Rules 6

Makes sure the rule is in the latest format. If not it will be upgraded automatically.

1 call to rules_rule_format_upgrade()
rules_admin_import_workflow_ng in rules_admin/rules_admin.export.inc
Tries to import workflow-ng rules.
1 string reference to 'rules_rule_format_upgrade'
rules_get_item_defaults in rules/rules.module
Returns all defined item defaults $item_type Which defaults to return, e.g. 'rules', 'rule_sets' or 'states'

File

rules/rules.module, line 1021
Rules engine module

Code

function rules_rule_format_upgrade($rule) {
  static $included = FALSE;
  $upgrades = array();
  if (!isset($rule['#version'])) {
    $upgrades[] = 'rules_rule_format_upgrade_6003';
  }
  if (!empty($upgrades) && !$included) {
    module_load_include('install', 'rules');
    $included = TRUE;
  }
  foreach ($upgrades as $upgrade) {
    $rule = $upgrade($rule);
  }
  return $rule;
}