You are here

function multiple_registration_user_register_form_validate in Multiple Registration 8

Same name and namespace in other branches
  1. 8.2 multiple_registration.module \multiple_registration_user_register_form_validate()
  2. 3.x multiple_registration.module \multiple_registration_user_register_form_validate()

Extra form validation handler for form_user_register_form().

1 string reference to 'multiple_registration_user_register_form_validate'
multiple_registration_form_user_register_form_alter in ./multiple_registration.module
Implements hook_form_FORM_ID_alter().

File

./multiple_registration.module, line 235
Contains multiple_registration.module.

Code

function multiple_registration_user_register_form_validate(array &$form, FormStateInterface $form_state) {
  $rid = $form_state
    ->getValue('rid');

  // Force enable the role to user.
  $form_state
    ->setValue([
    'roles',
    $rid,
  ], $rid);
}