protected function BooleanOperator::valueValidate in Zircon Profile 8.0
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 168 - Contains \Drupal\views\Plugin\views\filter\BooleanOperator.
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(array(
'options',
'value',
)) == 'All' && !$form_state
->isValueEmpty(array(
'options',
'expose',
'required',
))) {
$form_state
->setErrorByName('value', $this
->t('You must select a value unless this is an non-required exposed filter.'));
}
}