fix: use the right user id when changing the email#41539
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
DeepDiver1975
left a comment
There was a problem hiding this comment.
unit testable? Thank you
Previously, the test only used one user, so it was difficult to verify that the mail was changed for the user2 instead of user1
c594d46 to
5e57b95
Compare
Code ReviewOverviewThis PR fixes a bug in Source Fix
- $this->setEmailAddress($userId, $mailAddress);
+ $this->setEmailAddress($id, $mailAddress);Correct and minimal. The fix is exactly right — Test ChangesImprovements:
Concerns:
Process
Summary
The core fix is sound. I'd suggest:
|
Description
Change the email of the right user. Note that the code path isn't reachable from the web UI.
Note that there are checks some lines above for the existence of the user, so if we reach this particular line we know that there is an existing user with that id, no need to check it again.
Related Issue
Motivation and Context
How Has This Been Tested?
Manually tested using curl. It now changes the target user's email instead of the admin's (requester) email.
Screenshots (if appropriate):
Types of changes
Checklist: