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

Fixed issue #18936: User count in group is not OK after deleting a user #3306

Conversation

gabrieljenik
Copy link
Collaborator

@gabrieljenik gabrieljenik commented Jul 25, 2023

  • Moved code to a new function on a service class
  • Added the "remove from groups" operation

@Shnoulle Shnoulle added Code review done Version checked for code issue without testing and removed Needs code review labels Jul 26, 2023
@tiborpacalat tiborpacalat added Tested OK This PR has been tested by QA and works as expected and removed Needs testing labels Aug 3, 2023
@tiborpacalat tiborpacalat merged commit 2fee7cc into 5.x Aug 3, 2023
9 checks passed
@tiborpacalat tiborpacalat deleted the bug/18936--User-count-in-group-is-not-OK-after-deleting-a-user branch August 3, 2023 13:43
* @param int $userId
* @return OperationResult
*/
public function deleteUser($userId)
Copy link
Collaborator

@olleharstedt olleharstedt Aug 7, 2023

Choose a reason for hiding this comment

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

  1. If you already have target user in the constructor, why do you need $userId here?
  2. Maybe target user is not good to inject as a dependency in the constructor, but rather should be a method argument? Especially if it's only used by some methods.
  3. I usually prefer to pass around models instead of ids to models:
public function deleteUser(User $user)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code review done Version checked for code issue without testing Tested OK This PR has been tested by QA and works as expected
Projects
None yet
6 participants