You are here

protected function KeywordId::valueValidate in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Plugin/views/filter/KeywordId.php \Drupal\bibcite_entity\Plugin\views\filter\KeywordId::valueValidate()

Validate the options form.

Overrides FilterPluginBase::valueValidate

File

modules/bibcite_entity/src/Plugin/views/filter/KeywordId.php, line 54

Class

KeywordId
Filter handler for keywords.

Namespace

Drupal\bibcite_entity\Plugin\views\filter

Code

protected function valueValidate($form, FormStateInterface $form_state) {
  $ids = [];
  if ($values = $form_state
    ->getValue([
    'options',
    'value',
  ])) {
    foreach ($values as $value) {
      $ids[] = $value['target_id'];
    }
    sort($ids);
  }
  $form_state
    ->setValue([
    'options',
    'value',
  ], $ids);
}