Add batch lookup for user groups and titles on Special:ActiveUsers
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 29 Dec 2014 21:44:56 +0000 (22:44 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Mon, 29 Dec 2014 21:45:14 +0000 (22:45 +0100)
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
includes/specials/SpecialListusers.php

index fe06375..ff63243 100644 (file)
@@ -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 '';
                        }
index 0b40d2f..28e980c 100644 (file)
@@ -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