From 857c71aa861405ec5ecf969d055fd150f90daf90 Mon Sep 17 00:00:00 2001 From: Laurens Meurs Date: Sun, 22 Nov 2015 15:10:56 +0100 Subject: [PATCH] Rerolled patch 2393189-1 --- email_registration.module | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/email_registration.module b/email_registration.module index 23cc742..d1c51b7 100644 --- a/email_registration.module +++ b/email_registration.module @@ -191,7 +191,7 @@ function email_registration_form_user_admin_settings_submit($form, &$form_state) * * Allows users to authenticate by email, which is our preferred method. */ -function email_registration_user_login_validate($form, &$form_state) { +function email_registration_user_login_validate($element, &$form_state, $form) { $name = NULL; if (isset($form_state['values']['name']) && valid_email_address($form_state['values']['name'])) { // Try to load the username matching the email, if any exists. @@ -203,7 +203,10 @@ function email_registration_user_login_validate($form, &$form_state) { } // If the value is set, and a valid email, and a match was found, use it. if (!empty($name)) { - // Keep the email value in form state for further use/validation. + // Keep the mail value in form state for further use/validation. + $form_state['values']['mail'] = $form_state['values']['name']; + // We used to set the email value, still set this value to stay backwards + // compatible. $form_state['values']['email'] = $form_state['values']['name']; // If the name matches an e-mail, assume that it's the desired name and -- 1.9.1