r84261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84260‎ | r84261 | r84262 >
Date:20:30, 18 March 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Followup r84260, normalise API behaviour, and fixup description
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryFilearchive.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryFilearchive.php
@@ -138,15 +138,14 @@
139139 $file['userid'] = $row->fa_user;
140140 $file['user'] = $row->fa_user_text;
141141 }
142 - if ( $fld_size ) {
 142+ if ( $fld_size || $fld_dimensions ) {
143143 $file['size'] = $row->fa_size;
144144
145145 $pageCount = ArchivedFile::newFromRow( $row )->pageCount();
146146 if ( $pageCount !== false ) {
147147 $vals['pagecount'] = $pageCount;
148148 }
149 - }
150 - if ( $fld_dimensions ) {
 149+
151150 $file['height'] = $row->fa_height;
152151 $file['width'] = $row->fa_width;
153152 }
@@ -240,7 +239,7 @@
241240 ' timestamp - Adds timestamp for the uploaded version',
242241 ' user - Adds user who uploaded the image version',
243242 ' size - Adds the size of the image in bytes and the height, width and page count (if applicable)',
244 - ' dimensions - Adds the height and width of the image',
 243+ ' dimensions - Alias for size',
245244 ' description - Adds description the image version',
246245 ' mime - Adds MIME of the image',
247246 ' metadata - Lists EXIF metadata for the version of the image',

Follow-up revisions

RevisionCommit summaryAuthorDate
r84264Improve query building if's to cater for addition of columnsreedy20:50, 18 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84260Followup r83862, add notation that page count will be added if appropriatereedy19:55, 18 March 2011

Comments

#Comment by Duplicatebug (talk | contribs)   20:49, 18 March 2011

The fields are not selected with faprop=size:

		if ( $fld_dimensions ) {
			$this->addFields( array( 'fa_height', 'fa_width' ) );
		}
#Comment by Aaron Schulz (talk | contribs)   21:19, 17 June 2011

Tagging.

#Comment by Aaron Schulz (talk | contribs)   21:22, 17 June 2011

Follow-up wasn't tagged; added.

Status & tagging log