r50423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50422‎ | r50423 | r50424 >
Date:09:25, 10 May 2009
Author:catrope
Status:ok (Comments)
Tags:
Comment:
API: (bug 18743) Add ucprop=size (enabled by default) to list=usercontribs. Also fix warning from r49732
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -53,6 +53,7 @@
5454 $this->fld_ids = isset($prop['ids']);
5555 $this->fld_title = isset($prop['title']);
5656 $this->fld_comment = isset($prop['comment']);
 57+ $this->fld_size = isset($prop['size']);
5758 $this->fld_flags = isset($prop['flags']);
5859 $this->fld_timestamp = isset($prop['timestamp']);
5960 $this->fld_patrolled = isset($prop['patrolled']);
@@ -161,7 +162,7 @@
162163 }
163164
164165 if(!$wgUser->isAllowed('hideuser'))
165 - $this->addWhereFld('rev_deleted & ' . Revision::DELETED_USER . ' = 0');
 166+ $this->addWhere('rev_deleted & ' . Revision::DELETED_USER . ' = 0');
166167 // We only want pages by the specified users.
167168 if($this->prefixMode)
168169 $this->addWhere("rev_user_text LIKE '" . $this->getDB()->escapeLike($this->userprefix) . "%'");
@@ -240,6 +241,7 @@
241242 $this->addFieldsIf('page_latest', $this->fld_flags);
242243 // $this->addFieldsIf('rev_text_id', $this->fld_ids); // Should this field be exposed?
243244 $this->addFieldsIf('rev_comment', $this->fld_comment);
 245+ $this->addFieldsIf('rev_len', $this->fld_size);
244246 $this->addFieldsIf('rev_minor_edit', $this->fld_flags);
245247 $this->addFieldsIf('rev_parent_id', $this->fld_flags);
246248 $this->addFieldsIf('rc_patrolled', $this->fld_patrolled);
@@ -286,6 +288,9 @@
287289
288290 if ($this->fld_patrolled && $row->rc_patrolled)
289291 $vals['patrolled'] = '';
 292+
 293+ if ($this->fld_size )
 294+ $vals['size'] = intval($row->rev_len);
290295
291296 return $vals;
292297 }
@@ -329,12 +334,13 @@
330335 ),
331336 'prop' => array (
332337 ApiBase :: PARAM_ISMULTI => true,
333 - ApiBase :: PARAM_DFLT => 'ids|title|timestamp|flags|comment',
 338+ ApiBase :: PARAM_DFLT => 'ids|title|timestamp|comment|size|flags',
334339 ApiBase :: PARAM_TYPE => array (
335340 'ids',
336341 'title',
337342 'timestamp',
338343 'comment',
 344+ 'size',
339345 'flags',
340346 'patrolled',
341347 )
Index: trunk/phase3/RELEASE-NOTES
@@ -137,6 +137,7 @@
138138 output
139139 * (bug 18731) Show correct SVN links for extension modules in api.php?version
140140 * (bug 18730) Add version information to action=paraminfo output
 141+* (bug 18743) Add ucprop=size to list=usercontribs
141142
142143 === Languages updated in 1.16 ===
143144

Follow-up revisions

RevisionCommit summaryAuthorDate
r50600Followup to r50423: Check if the row is null, since older revs don't necessar...demon20:29, 14 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49732API: (bug 18554) Also list hidden revisions in list=usercontribs for privileg...catrope09:21, 22 April 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   16:53, 11 May 2009

This reports size=0 for revisions with unmigrated rev_len=NULL.

Status & tagging log