You are here

function commerce_update_7100 in Commerce Core 7

Update Rules to use new prefixed parameter names and tokens.

File

./commerce.install, line 37

Code

function commerce_update_7100() {
  drupal_flush_all_caches();

  // Loop over all defined Rules configurations.
  foreach (rules_config_load_multiple(FALSE) as $rule) {
    $events = FALSE;
    if ($rule instanceof RulesContainerPlugin) {
      if ($rule instanceof RulesReactionRule) {
        $events = $rule
          ->events();
      }
      _commerce_update_rule_container_tokens($rule, $events);
    }
    else {
      _commerce_update_rule_tokens($rule, $events);
    }
  }
  return t('Rules updated to match new parameter names and token names.');
}