r71834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71833‎ | r71834 | r71835 >
Date:00:52, 28 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Couple more userid properties for Bug 19195
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -52,6 +52,7 @@
5353 $prop = array_flip( $params['prop'] );
5454 $fld_revid = isset( $prop['revid'] );
5555 $fld_user = isset( $prop['user'] );
 56+ $fld_userid = isset( $prop['userid'] );
5657 $fld_comment = isset( $prop['comment'] );
5758 $fld_parsedcomment = isset ( $prop['parsedcomment'] );
5859 $fld_minor = isset( $prop['minor'] );
@@ -87,6 +88,9 @@
8889 if ( $fld_user ) {
8990 $this->addFields( 'ar_user_text' );
9091 }
 92+ if ( $fld_userid ) {
 93+ $this->addFields( 'ar_user' );
 94+ }
9195 if ( $fld_comment || $fld_parsedcomment ) {
9296 $this->addFields( 'ar_comment' );
9397 }
@@ -202,6 +206,9 @@
203207 if ( $fld_user ) {
204208 $rev['user'] = $row->ar_user_text;
205209 }
 210+ if ( $fld_userid ) {
 211+ $rev['userid'] = $row->ar_user;
 212+ }
206213 if ( $fld_comment ) {
207214 $rev['comment'] = $row->ar_comment;
208215 }
@@ -290,6 +297,7 @@
291298 ApiBase::PARAM_TYPE => array(
292299 'revid',
293300 'user',
 301+ 'userid',
294302 'comment',
295303 'parsedcomment',
296304 'minor',
@@ -311,7 +319,8 @@
312320 'prop' => array(
313321 'Which properties to get',
314322 ' revid - Adds the revision id of the deleted revision',
315 - ' user - Adds user who made the revision',
 323+ ' user - Adds the user who made the revision',
 324+ ' userid - Adds the user id whom made the revision',
316325 ' comment - Adds the comment of the revision',
317326 ' parsedcomment - Adds the parsed comment of the revision',
318327 ' minor - Tags if the revision is minor',
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -51,6 +51,7 @@
5252 $this->fld_type = isset( $prop['type'] );
5353 $this->fld_action = isset ( $prop['action'] );
5454 $this->fld_user = isset( $prop['user'] );
 55+ $this->fld_userid = isset( $prop['userid'] );
5556 $this->fld_timestamp = isset( $prop['timestamp'] );
5657 $this->fld_comment = isset( $prop['comment'] );
5758 $this->fld_parsedcomment = isset ( $prop['parsedcomment'] );
@@ -84,6 +85,7 @@
8586 $this->addFieldsIf( 'page_id', $this->fld_ids );
8687 $this->addFieldsIf( 'log_user', $this->fld_user );
8788 $this->addFieldsIf( 'user_name', $this->fld_user );
 89+ $this->addFieldsIf( 'user_id', $this->fld_userid );
8890 $this->addFieldsIf( 'log_namespace', $this->fld_title || $this->fld_parsedcomment );
8991 $this->addFieldsIf( 'log_title', $this->fld_title || $this->fld_parsedcomment );
9092 $this->addFieldsIf( 'log_comment', $this->fld_comment || $this->fld_parsedcomment );
@@ -259,11 +261,17 @@
260262 }
261263 }
262264
263 - if ( $this->fld_user ) {
 265+ if ( $this->fld_user || $this->fld_userid ) {
264266 if ( LogEventsList::isDeleted( $row, LogPage::DELETED_USER ) ) {
265267 $vals['userhidden'] = '';
266268 } else {
267 - $vals['user'] = $row->user_name;
 269+ if ( $this->fld_user ) {
 270+ $vals['user'] = $row->user_name;
 271+ }
 272+ if ( $this->fld_userid ) {
 273+ $vals['userid'] = $row->user_id;
 274+ }
 275+
268276 if ( !$row->log_user ) {
269277 $vals['anon'] = '';
270278 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r71836r71834, params and desc would be goodreedy00:57, 28 August 2010

Status & tagging log