public function FilterPluginBase::validateExposeForm

Validate the options form.

Overrides HandlerBase::validateExposeForm

1 call to FilterPluginBase::validateExposeForm()
FilterPluginBase::validateOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
Simple validate handler

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php, line 605
Definition of Drupal\views\Plugin\views\filter\FilterPluginBase.

Class

FilterPluginBase
Base class for filters.

Namespace

Drupal\views\Plugin\views\filter

Code

public function validateExposeForm($form, &$form_state) {
  if (empty($form_state['values']['options']['expose']['identifier'])) {
    form_error($form['expose']['identifier'], t('The identifier is required if the filter is exposed.'));
  }
  if (!empty($form_state['values']['options']['expose']['identifier']) && $form_state['values']['options']['expose']['identifier'] == 'value') {
    form_error($form['expose']['identifier'], t('This identifier is not allowed.'));
  }
  if (!$this->view->display_handler
    ->isIdentifierUnique($form_state['id'], $form_state['values']['options']['expose']['identifier'])) {
    form_error($form['expose']['identifier'], t('This identifier is used by another handler.'));
  }
}