public function TaxonomyIndexTid::validateExposed in Views (for Drupal 7) 8.3
Validate the exposed handler form
Overrides HandlerBase::validateExposed
File
- lib/
Views/ taxonomy/ Plugin/ views/ filter/ TaxonomyIndexTid.php, line 264 - Definition of views_handler_filter_term_node_tid.
Class
- TaxonomyIndexTid
- Filter by term id.
Namespace
Views\taxonomy\Plugin\views\filterCode
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;
}
}