You are here

public function WizardPluginBase::validateView in Views (for Drupal 7) 8.3

Implements Drupal\views\Plugin\views\wizard\WizardInterface::validate().

Instantiates the view from the form submission and validates its values.

Overrides WizardInterface::validateView

File

lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 1067
Definition of Drupal\views\Plugin\views\wizard\WizardPluginBase.

Class

WizardPluginBase
Provides the interface and base class for Views Wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

public function validateView(array $form, array &$form_state) {
  $view = $this
    ->instantiate_view($form, $form_state);
  $errors = $view
    ->validate();
  if (!is_array($errors) || empty($errors)) {
    $this
      ->set_validated_view($form, $form_state, $view);
    return array();
  }
  return $errors;
}