From 4c30ba66ebf46b94826f73742abbcab7d4dbe80d Mon Sep 17 00:00:00 2001 From: MKiselev Date: Wed, 9 Aug 2017 01:25:43 +0500 Subject: [PATCH] Issue #49 fix make() should pass attributes as third parameter not second --- CHANGELOG.md | 2 +- src/User/Controller/RegistrationController.php | 1 + src/User/Service/SocialNetworkAccountConnectService.php | 1 + src/User/Service/SocialNetworkAuthenticateService.php | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c7fe6..1fefe2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # CHANGELOG ## 1.0.13 - Work in progress - +- Fix #49: Fix wrong call of method make() for set attributes (MKiselev) ## 1.0.12 - August 6, 2017 - Bug Fix: Modify ResetPasswordService to forcely update password_hash field (tonydspaniard) diff --git a/src/User/Controller/RegistrationController.php b/src/User/Controller/RegistrationController.php index 49b0071..3dc21ff 100644 --- a/src/User/Controller/RegistrationController.php +++ b/src/User/Controller/RegistrationController.php @@ -145,6 +145,7 @@ class RegistrationController extends Controller /** @var User $user */ $user = $this->make( User::class, + [], ['scenario' => 'connect', 'username' => $account->username, 'email' => $account->email] ); $event = $this->make(SocialNetworkConnectEvent::class, [$user, $account]); diff --git a/src/User/Service/SocialNetworkAccountConnectService.php b/src/User/Service/SocialNetworkAccountConnectService.php index fbf9cc7..2d6a7a5 100644 --- a/src/User/Service/SocialNetworkAccountConnectService.php +++ b/src/User/Service/SocialNetworkAccountConnectService.php @@ -80,6 +80,7 @@ class SocialNetworkAccountConnectService implements ServiceInterface $account = $this->make( SocialNetworkAccount::class, + [], [ 'provider' => $this->client->getId(), 'client_id' => $data['id'], diff --git a/src/User/Service/SocialNetworkAuthenticateService.php b/src/User/Service/SocialNetworkAuthenticateService.php index bbdcc02..4787fca 100644 --- a/src/User/Service/SocialNetworkAuthenticateService.php +++ b/src/User/Service/SocialNetworkAuthenticateService.php @@ -91,6 +91,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface /** @var SocialNetworkAccount $account */ $account = $this->controller->make( SocialNetworkAccount::class, + [], [ 'provider' => $this->client->getId(), 'client_id' => $data['id'], @@ -119,6 +120,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface /** @var User $user */ $user = $this->controller->make( User::class, + [], [ 'scenario' => 'connect', 'username' => $account->username,