public function Search::validateExposed in Views (for Drupal 7) 8.3
Validate the options form.
Overrides HandlerBase::validateExposed
File
- lib/
Views/ search/ Plugin/ views/ filter/ Search.php, line 82 - Definition of Views\search\Plugin\views\filter\Search.
Class
- Search
- Field handler to provide simple renderer that allows linking to a node.
Namespace
Views\search\Plugin\views\filterCode
public function validateExposed(&$form, &$form_state) {
if (!isset($this->options['expose']['identifier'])) {
return;
}
$key = $this->options['expose']['identifier'];
if (!empty($form_state['values'][$key])) {
$this
->query_parse_search_expression($form_state['values'][$key]);
if (count($this->search_query
->words()) == 0) {
form_set_error($key, format_plural(config('search.settings')
->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
}
}
}