Page MenuHomePhabricator

Create new UserGroupManager::addUserToGroups method
Closed, ResolvedPublic


This ticket is the result of the following comments:


UserGroupManager::addUserToGroups method should help to avoid such situations --->

foreach ( $promotions as $promotion ) {
    $userGroupManager->addUserToGroup( $user, $promotion );

an exapmle

The new method must loop through the list of groups and call UserGroupManager::addUserToGroup every iteration.

How must this ticket be accomplished?

  1. You need to create the patch for the core in which you add new UserGroupManager::addUserToGroups method, create some test cases for the new method, replace all uses of a loop and UserGroupManager::addUserToGroup with ::addUserToGroups .
  2. Find all uses of the examples above in the other codebases, file a separate ticket for each codebase and create an appropriate patch.

Event Timeline

Change 715273 had a related patch set uploaded (by TChin; author: TChin):

[mediawiki/core@master] Create new UserGroupManager::addUserToGroups method

Change 715273 merged by jenkins-bot:

[mediawiki/core@master] Create new UserGroupManager::addUserToMultipleGroups method