You are here

public function TermReference::validateExposed in EntityFieldQuery Views Backend 8

Validate the exposed handler form

Overrides HandlerBase::validateExposed

File

src/Plugin/views/filter/TermReference.php, line 245
Contains \Drupal\efq_views\Plugin\views\filter\FieldInOperator.

Class

TermReference
Filter by term id.

Namespace

Drupal\efq_views\Plugin\views\filter

Code

public function validateExposed(&$form, FormStateInterface $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
    ->validateTermStrings($form[$identifier], $values);
  if ($tids) {
    $this->validated_exposed_input = $tids;
  }
}