summaryrefslogtreecommitdiff
path: root/includes/api/ApiQueryWatchlist.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiQueryWatchlist.php')
-rw-r--r--includes/api/ApiQueryWatchlist.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php
index a1a33728..90b12c14 100644
--- a/includes/api/ApiQueryWatchlist.php
+++ b/includes/api/ApiQueryWatchlist.php
@@ -116,7 +116,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
) );
$userId = $user->getId();
- $this->addJoinConds( array( 'watchlist' => array('INNER JOIN',
+ $this->addJoinConds( array( 'watchlist' => array( 'INNER JOIN',
array(
'wl_user' => $userId,
'wl_namespace=rc_namespace',
@@ -240,14 +240,16 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
if ( $this->fld_user || $this->fld_userid ) {
- if ( $this->fld_user ) {
- $vals['user'] = $row->rc_user_text;
- }
-
if ( $this->fld_userid ) {
+ $vals['userid'] = $row->rc_user;
+ // for backwards compatibility
$vals['user'] = $row->rc_user;
}
+ if ( $this->fld_user ) {
+ $vals['user'] = $row->rc_user_text;
+ }
+
if ( !$row->rc_user ) {
$vals['anon'] = '';
}
@@ -511,15 +513,11 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
'api.php?action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment',
'api.php?action=query&generator=watchlist&prop=info',
'api.php?action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user',
- 'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=d8d562e9725ea1512894cdab28e5ceebc7f20237'
+ 'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=123ABC'
);
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Watchlist';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}