You are here

protected function TaxonomyIndexTid::valueValidate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::valueValidate()

Validate the options form.

Overrides FilterPluginBase::valueValidate

File

core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php, line 259
Contains \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid.

Class

TaxonomyIndexTid
Filter by term id.

Namespace

Drupal\taxonomy\Plugin\views\filter

Code

protected function valueValidate($form, FormStateInterface $form_state) {

  // We only validate if they've chosen the text field style.
  if ($this->options['type'] != 'textfield') {
    return;
  }
  $tids = array();
  foreach ($form_state
    ->getValue(array(
    'options',
    'value',
  )) as $value) {
    $tids[] = $value['target_id'];
  }
  $form_state
    ->setValue(array(
    'options',
    'value',
  ), $tids);
}