Followup to r60587: wrong user_groups join
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 3 Jan 2010 20:16:25 +0000 (20:16 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 3 Jan 2010 20:16:25 +0000 (20:16 +0000)
includes/api/ApiQueryAllUsers.php

index ba7dd1f..a499e90 100644 (file)
@@ -65,6 +65,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addWhere('u1.user_name' . $db->buildLike($this->keyToTitle($params['prefix']), $db->anyString()));
 
                if (!is_null($params['group'])) {
+                       $useIndex = false;
                        // Filter only users that belong to a given group
                        $this->addTables('user_groups', 'ug1');
                        $ug1 = $this->getAliasedName('user_groups', 'ug1');
@@ -76,7 +77,6 @@ class ApiQueryAllUsers extends ApiQueryBase {
                        $this->addWhere('user_editcount > 0');
 
                if ($fld_groups) {
-                       $useIndex = false;
                        // Show the groups the given users belong to
                        // request more than needed to avoid not getting all rows that belong to one user
                        $groupCount = count(User::getAllGroups());