r25212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25211‎ | r25212 | r25213 >
Date:21:32, 27 August 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 11072) Fix regression in API image history query
LocalFile::nextHistoryLine() now returns original column names for oldimage rows instead of aliasing them to image column names.
That whole interface should fucking die, it's hideous.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -67,24 +67,26 @@
6868
6969 $isCur = true;
7070 while($line = $img->nextHistoryLine()) { // assignment
 71+ $row = get_object_vars( $line );
7172 $vals = array();
 73+ $prefix = $isCur ? 'img' : 'oi';
7274
7375 if ($fld_timestamp)
74 - $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $line->img_timestamp);
 76+ $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row["${prefix}_timestamp"]);
7577 if ($fld_user) {
76 - $vals['user'] = $line->img_user_text;
77 - if(!$line->img_user)
 78+ $vals['user'] = $row["${prefix}_user_text"];
 79+ if(!$row["${prefix}_user"])
7880 $vals['anon'] = '';
7981 }
8082 if ($fld_size) {
81 - $vals['size'] = intval($line->img_size);
82 - $vals['width'] = intval($line->img_width);
83 - $vals['height'] = intval($line->img_height);
 83+ $vals['size'] = intval($row["{$prefix}_size"]);
 84+ $vals['width'] = intval($row["{$prefix}_width"]);
 85+ $vals['height'] = intval($row["{$prefix}_height"]);
8486 }
8587 if ($fld_url)
86 - $vals['url'] = $isCur ? $img->getURL() : $img->getArchiveUrl($line->oi_archive_name);
 88+ $vals['url'] = $isCur ? $img->getURL() : $img->getArchiveUrl($row["oi_archive_name"]);
8789 if ($fld_comment)
88 - $vals['comment'] = $line->img_description;
 90+ $vals['comment'] = $row["{$prefix}_description"];
8991
9092 $data[] = $vals;
9193
Index: trunk/phase3/RELEASE-NOTES
@@ -417,6 +417,7 @@
418418 * Preventing the TOC from appearing in Special:Statistics
419419 * (bug 11082) Fix check for fully-specced table names in Database::tableName
420420 * (bug 11067) Fix regression in upload conflict thumbnail display
 421+* (bug 11072) Fix regression in API image history query
421422
422423
423424 == API changes since 1.10 ==

Follow-up revisions

RevisionCommit summaryAuthorDate
r25223Merged revisions 25126-25214 via svnmerge from...david07:39, 28 August 2007

Status & tagging log