function Name::valueValidate
Same name and namespace in other branches
- 9 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::valueValidate()
- 8.9.x core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::valueValidate()
- 10 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::valueValidate()
Validate the options form.
Parameters
array $form: Associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FilterPluginBase::valueValidate
File
-
core/
modules/ user/ src/ Plugin/ views/ filter/ Name.php, line 58
Class
- Name
- Filter handler for usernames.
Namespace
Drupal\user\Plugin\views\filterCode
protected function valueValidate($form, FormStateInterface $form_state) {
$uids = [];
if ($values = $form_state->getValue([
'options',
'value',
])) {
foreach ($values as $value) {
$uids[] = $value['target_id'];
}
sort($uids);
}
$form_state->setValue([
'options',
'value',
], $uids);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.