public function TaxonomyIndexTid::validateExposed in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::validateExposed()
Validate the exposed handler form
Overrides HandlerBase::validateExposed
File
- core/
modules/ taxonomy/ src/ Plugin/ views/ filter/ TaxonomyIndexTid.php, line 311 - Contains \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid.
Class
- TaxonomyIndexTid
- Filter by term id.
Namespace
Drupal\taxonomy\Plugin\views\filterCode
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
->getValue($identifier) != 'All') {
$this->validated_exposed_input = (array) $form_state
->getValue($identifier);
}
return;
}
if (empty($this->options['expose']['identifier'])) {
return;
}
foreach ($form_state
->getValue($identifier) as $value) {
$this->validated_exposed_input[] = $value['target_id'];
}
}