r74392 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74391‎ | r74392 | r74393 >
Date:21:16, 6 October 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Followup r71831, User::newFromName, not newFromText
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -377,7 +377,7 @@
378378 $vals['user'] = $revision->getUserText();
379379 }
380380 if ( $this->fld_userid ) {
381 - $user = User::newFromText( $revision->getUserText() );
 381+ $user = User::newFromName( $revision->getUserText() );
382382 $vals['userid'] = $user->getId();
383383 }
384384 if ( !$revision->getUser() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r74911Followup r74392. Also cache result of getUser call (may be called twice)reedy18:54, 17 October 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71831Part of Bug 19195 - Make user IDs more readily available with the API...reedy00:37, 28 August 2010

Comments

#Comment by Bryan (talk | contribs)   17:20, 16 October 2010

The revision object has a getUser method which returns the user id directly. No need to construct a User object yourself.

Status & tagging log