function rules_scheduler_action_schedule_validate

Validate callback for the schedule action.

Makes sure the component exists and is not dirty.

See also

rules_element_invoke_component_validate()

Related topics

File

rules_scheduler/rules_scheduler.rules.inc, line 127

Code

function rules_scheduler_action_schedule_validate(RulesPlugin $element) {
    $info = $element->info();
    $component = rules_config_load($element->settings['component']);
    if (!$component) {
        throw new RulesIntegrityException(t('The component %config does not exist.', array(
            '%config' => $element->settings['component'],
        )), $element);
    }
    // Check if the component is marked as dirty.
    rules_config_update_dirty_flag($component);
    if (!empty($component->dirty)) {
        throw new RulesIntegrityException(t('The utilized component %config fails the integrity check.', array(
            '%config' => $element->settings['component'],
        )), $element);
    }
}