From 85cb9ef070c089b7016a575c8d738e738fb03ddb Mon Sep 17 00:00:00 2001 From: Marcelo Briones Date: Sat, 12 Aug 2017 16:23:25 -0300 Subject: [PATCH] Fix registration when useEmailAsLogin is true --- models/forms/RegistrationForm.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/models/forms/RegistrationForm.php b/models/forms/RegistrationForm.php index 8f547597..72918ae1 100644 --- a/models/forms/RegistrationForm.php +++ b/models/forms/RegistrationForm.php @@ -89,6 +89,7 @@ public function registerUser($performValidation = true) } $user = new User(); + $user->username = $this->username; $user->password = $this->password; if ( Yii::$app->getModule('user-management')->useEmailAsLogin ) @@ -119,10 +120,6 @@ public function registerUser($performValidation = true) $user->username = $this->username; } } - else - { - $user->username = $this->username; - } if ( $user->save() )