You are here

function BooleanOperator::value_validate in Views (for Drupal 7) 8.3

Validate the options form.

Overrides FilterPluginBase::value_validate

File

lib/Drupal/views/Plugin/views/filter/BooleanOperator.php, line 139
Definition of Drupal\views\Plugin\views\filter\BooleanOperator.

Class

BooleanOperator
Simple filter to handle matching of boolean values

Namespace

Drupal\views\Plugin\views\filter

Code

function value_validate($form, &$form_state) {
  if ($form_state['values']['options']['value'] == 'All' && !empty($form_state['values']['options']['expose']['required'])) {
    form_set_error('value', t('You must select a value unless this is an non-required exposed filter.'));
  }
}