From c4030ede03e69ed7431bd21d138249057e74be36 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 29 Dec 2014 22:44:56 +0100 Subject: [PATCH] Add batch lookup for user groups and titles on Special:ActiveUsers Call parent of doBatchLookups to get the LinkBatch for the userpages. Use than the populated user group cache to get the groups from to display them. Follow-Up: I4a945f83ad28edf5cc040139943cf743cb3d133c Change-Id: Ibbabf40d60dd9f8e3667cf17455e7582b4ee472a --- includes/specials/SpecialActiveusers.php | 5 ++++- includes/specials/SpecialListusers.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index fe06375822..ff632439b7 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -124,6 +124,8 @@ class ActiveUsersPager extends UsersPager { } function doBatchLookups() { + parent::doBatchLookups(); + $uids = array(); foreach ( $this->mResult as $row ) { $uids[] = $row->user_id; @@ -172,7 +174,8 @@ class ActiveUsersPager extends UsersPager { // Note: This is a different loop than for user rights, // because we're reusing it to build the group links // at the same time - foreach ( $user->getGroups() as $group ) { + $groups_list = self::getGroups( intval( $row->user_id ), $this->userGroupCache ); + foreach ( $groups_list as $group ) { if ( in_array( $group, $this->hideGroups ) ) { return ''; } diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 0b40d2f1e7..28e980c9a2 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -37,7 +37,7 @@ class UsersPager extends AlphabeticPager { /** * @var array A array with user ids as key and a array of groups as value */ - private $userGroupCache; + protected $userGroupCache; /** * @param IContextSource $context -- 2.20.1