You are here

function views_rules_collect_rows_validate in Views Rules 7

Validates the action.

File

rules/views_rules.action.inc, line 67
Action implementation.

Code

function views_rules_collect_rows_validate(RulesPlugin $element) {
  $view_display_id = $element->settings['views_rules_display'];
  $view = views_rules_get_view($view_display_id);
  if (!$view || !$view->display_handler) {
    throw new RulesIntegrityException(t('The view display %display does not exist.', array(
      '%display' => $view_display_id,
    )), $element);
  }
  if (!$view->display_handler instanceof views_rules_iterator) {
    throw new RulesIntegrityException(t('The view display %display is not a Rules display.', array(
      '%display' => $view_display_id,
    )), $element);
  }
  if (!$view
    ->validate()) {
    throw new RulesIntegrityException(t('The view display %display does not validate.', array(
      '%display' => $view_display_id,
    )), $element);
  }
}