Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-31825: Use "updateUserPassword" if newer ezplatform-kernel is available #80

Merged
merged 2 commits into from
Oct 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/bundle/Controller/PasswordChangeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,18 @@ public function userPasswordChangeAction(Request $request)
$newPassword = $data->getNewPassword();
$userUpdateStruct = $this->userService->newUserUpdateStruct();
$userUpdateStruct->password = $newPassword;
$this->userService->updateUser($user, $userUpdateStruct);
if (method_exists($this->userService, 'updateUserPassword')) {
Copy link
Contributor

@ViniTou ViniTou Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point of doing it that way, both versions (this and kernel) gonna released at the same time. What you should do is rebase this PR against 2.1 branch.

Copy link
Member

@alongosz alongosz Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point of doing it that way, both versions (this and kernel) gonna released at the same time. What you should do is rebase this PR against 2.1 branch.

@Steveb-p ☝️ bump required ezplatform-kernel version instead, please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alongosz @ViniTou what version should be targetted?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->userService->updateUserPassword($user, $userUpdateStruct);
} else {
@trigger_error(
sprintf(
'%1$s::updateUser method used for changing user password is deprecated. Use "%1$s::updateUserPassword" instead, introduced in newer ezplatform-kernel.',
get_class($this->userService)
),
E_USER_DEPRECATED
);
$this->userService->updateUser($user, $userUpdateStruct);
}

if ((new IsAdmin($this->siteAccessGroups))->isSatisfiedBy($request->attributes->get('siteaccess'))) {
$this->notificationHandler->success(
Expand Down