protected function Name::valueValidate in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::valueValidate()
- 9 core/modules/user/src/Plugin/views/filter/Name.php \Drupal\user\Plugin\views\filter\Name::valueValidate()
Validate the options form.
Overrides FilterPluginBase::valueValidate
File
- core/
modules/ user/ src/ Plugin/ views/ filter/ Name.php, line 41
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);
}