public function SettingsForm::validateForm in Bulk User Registration 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormBase::validateForm
File
- src/
Form/ SettingsForm.php, line 50
Class
- SettingsForm
- Configure locale settings for this site.
Namespace
Drupal\bulk_user_registration\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// Force set the authenticated role.
$roles = $form_state
->getValue('allowed_roles');
$roles[UserInterface::AUTHENTICATED_ROLE] = UserInterface::AUTHENTICATED_ROLE;
$form_state
->setValue('allowed_roles', $roles);
}