diff --git a/src/User/Command/CreateController.php b/src/User/Command/CreateController.php index 0534289..24a9fcd 100644 --- a/src/User/Command/CreateController.php +++ b/src/User/Command/CreateController.php @@ -28,6 +28,7 @@ class CreateController extends Controller /** @var User $user */ $user = $this->make( User::class, + [], ['scenario' => 'create', 'email' => $email, 'username' => $username, 'password' => $password] ); $mailService = MailFactory::makeWelcomeMailerService($user); diff --git a/src/User/Model/Profile.php b/src/User/Model/Profile.php index 6e1151b..949ac86 100644 --- a/src/User/Model/Profile.php +++ b/src/User/Model/Profile.php @@ -72,7 +72,7 @@ class Profile extends ActiveRecord 'timeZoneValidation' => [ 'timezone', function ($attribute) { - if ($this->make(TimeZoneValidator::class, [$attribute])->validate()) { + if ($this->make(TimeZoneValidator::class, [$this->{$attribute}])->validate()) { $this->addError($attribute, Yii::t('usuario', 'Time zone is not valid')); } },