You are here

function profile_form_user_register_form_validate in Profile 2 8

Extra form validation handler for the user registration form.

1 string reference to 'profile_form_user_register_form_validate'
profile_form_user_register_form_alter in ./profile.module
Implements hook_form_FORM_ID_alter().

File

./profile.module, line 199
Support for configurable user profiles.

Code

function profile_form_user_register_form_validate(array &$form, FormStateInterface $form_state) {
  $profiles = $form_state
    ->get('profiles');
  if (!empty($profiles)) {
    foreach ($profiles as $bundle => $entity) {
      $form_display = $form_state
        ->get('form_display_' . $bundle);
      $form_display
        ->extractFormValues($entity, $form['entity_' . $bundle], $form_state);
      $form_display
        ->validateFormValues($entity, $form['entity_' . $bundle], $form_state);
    }
  }
}