r105811 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105810‎ | r105811 | r105812 >
Date:18:39, 11 December 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 32415) Empty page get no size attribute in API output
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -404,8 +404,12 @@
405405 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $revision->getTimestamp() );
406406 }
407407
408 - if ( $this->fld_size && !is_null( $revision->getSize() ) ) {
409 - $vals['size'] = intval( $revision->getSize() );
 408+ if ( $this->fld_size ) {
 409+ if ( !is_null( $revision->getSize() ) ) {
 410+ $vals['size'] = intval( $revision->getSize() );
 411+ } else {
 412+ $vals['size'] = 0;
 413+ }
410414 }
411415
412416 if ( $this->fld_comment || $this->fld_parsedcomment ) {
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -203,6 +203,7 @@
204204 * Added 'APIGetDescription' hook.
205205 * (bug 32688) Paraminfo for parameter "generator" of the query module shows too
206206 many types
 207+* (bug 32415) Empty page get no size attribute in API output
207208
208209 === Languages updated in 1.19 ===
209210

Comments

#Comment by Duplicatebug (talk | contribs)   18:48, 17 December 2011

In my opinion it is wrong to give a size of '0', when the size is unknown in the database (field is null). Can some one look into the database and say, if the field is NULL or 0 for that page?

Status & tagging log