public function TaxonomyIndexTid::validateExposed

Validate the exposed handler form

Overrides HandlerBase::validateExposed

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php, line 255
Definition of views_handler_filter_term_node_tid.

Class

TaxonomyIndexTid
Filter by term id.

Namespace

Drupal\taxonomy\Plugin\views\filter

Code

public function validateExposed(&$form, &$form_state) {
  if (empty($this->options['exposed'])) {
    return;
  }
  $identifier = $this->options['expose']['identifier'];

  // We only validate if they've chosen the text field style.
  if ($this->options['type'] != 'textfield') {
    if ($form_state['values'][$identifier] != 'All') {
      $this->validated_exposed_input = (array) $form_state['values'][$identifier];
    }
    return;
  }
  if (empty($this->options['expose']['identifier'])) {
    return;
  }
  $values = drupal_explode_tags($form_state['values'][$identifier]);
  $tids = $this
    ->validate_term_strings($form[$identifier], $values);
  if ($tids) {
    $this->validated_exposed_input = $tids;
  }
}