function hook_rules_config_defaults_rebuild

Act after rebuilding default configurations.

This hook is invoked by the entity module after default rules configurations have been rebuilt; i.e. defaults have been saved to the database.

Parameters

array $rules_configs: The array of default rules configurations which have been inserted or updated, keyed by name.

array $originals: An array of original rules configurations keyed by name; i.e. the rules configurations before the current defaults have been applied. For inserted rules configurations no original is available.

See also

hook_default_rules_configuration()

entity_defaults_rebuild()

Related topics

1 function implements hook_rules_config_defaults_rebuild()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

rules_i18n_rules_config_defaults_rebuild in rules_i18n/rules_i18n.module
Implements hook_rules_config_defaults_rebuild().

File

./rules.api.php, line 917

Code

function hook_rules_config_defaults_rebuild($rules_configs, $originals) {
    // Once all defaults have been rebuilt, update all i18n strings at once. That
    // way we build the rules cache once the rebuild is complete and avoid
    // rebuilding caches for each updated rule.
    foreach ($rules_configs as $name => $rule_config) {
        if (empty($originals[$name])) {
            rules_i18n_rules_config_insert($rule_config);
        }
        else {
            rules_i18n_rules_config_update($rule_config, $originals[$name]);
        }
    }
}