You are here

function views_ui_edit_view_form_validate in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 6.3 includes/admin.inc \views_ui_edit_view_form_validate()
  2. 6.2 includes/admin.inc \views_ui_edit_view_form_validate()
  3. 7.3 includes/admin.inc \views_ui_edit_view_form_validate()

Validate that a view is complete and whole.

1 string reference to 'views_ui_edit_view_form_validate'
ViewUI::buildEditForm in views_ui/lib/Drupal/views_ui/ViewUI.php
Form builder callback for editing a View.

File

views_ui/admin.inc, line 582
Provides the Views' administrative interface.

Code

function views_ui_edit_view_form_validate($form, &$form_state) {

  // Do not validate cancel or delete or revert.
  if (empty($form_state['clicked_button']['#value']) || $form_state['clicked_button']['#value'] != t('Save')) {
    return;
  }
  $errors = $form_state['view']
    ->validate();
  if ($errors !== TRUE) {
    foreach ($errors as $error) {
      form_set_error('', $error);
    }
  }
}