protected function BooleanOperator::valueValidate in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/filter/BooleanOperator.php \Drupal\views\Plugin\views\filter\BooleanOperator::valueValidate()
Validate the options form.
Overrides FilterPluginBase::valueValidate
File
- core/
modules/ views/ src/ Plugin/ views/ filter/ BooleanOperator.php, line 189
Class
- BooleanOperator
- Simple filter to handle matching of boolean values.
Namespace
Drupal\views\Plugin\views\filterCode
protected function valueValidate($form, FormStateInterface $form_state) {
if ($form_state
->getValue([
'options',
'value',
]) == 'All' && !$form_state
->isValueEmpty([
'options',
'expose',
'required',
])) {
$form_state
->setErrorByName('value', $this
->t('You must select a value unless this is an non-required exposed filter.'));
}
}