From 20d56c63b3d98e7a01b9cc5c58fa766640b6b6af Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 25 Feb 2011 16:19:44 +0000 Subject: [PATCH] * (bug 27708) list=users does not have a property to return user id Add userid to ApiQueryUsers Move userid in ApiQueryAllUsers before name --- RELEASE-NOTES | 1 + includes/api/ApiQueryAllUsers.php | 2 +- includes/api/ApiQueryUsers.php | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5ebd6df2c5..c55f006d13 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -184,6 +184,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 27611) list=blocks: Use ipb_by_text instead of join with user table * (bug 27616) Add userid of blocked user and blocker to list=blocks * (bug 27688) Simplify queries to list user block information +* (bug 27708) list=users does not have a property to return user id === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 95fbbf2c84..22026f36ec 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -175,8 +175,8 @@ class ApiQueryAllUsers extends ApiQueryBase { // Record new user's data $lastUser = $row->user_name; $lastUserData = array( - 'name' => $lastUser, 'userid' => $row->user_id, + 'name' => $lastUser, ); if ( $fld_blockinfo && !is_null( $row->ipb_by_text ) ) { $lastUserData['blockedby'] = $row->ipb_by_text; diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 4fec5ad57f..910e255969 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -135,6 +135,8 @@ if ( !defined( 'MEDIAWIKI' ) ) { foreach ( $res as $row ) { $user = User::newFromRow( $row ); $name = $user->getName(); + + $data[$name]['userid'] = $user->getId(); $data[$name]['name'] = $name; if ( isset( $this->prop['editcount'] ) ) { -- 2.20.1