r23596 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23595‎ | r23596 | r23597 >
Date:06:45, 1 July 2007
Author:yurik
Status:old
Tags:
Comment:
API: Reverted back to r23531 for the reasons listed in bug 10297
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -41,7 +41,7 @@
4242 parent :: __construct($query, $moduleName, 'rv');
4343 }
4444
45 - private $fld_ids = false, $fld_lastid = false, $fld_flags = false, $fld_timestamp = false,
 45+ private $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
4646 $fld_comment = false, $fld_user = false, $fld_content = false;
4747
4848 public function execute() {
@@ -78,13 +78,10 @@
7979 $this->addFields('rev_page');
8080
8181 // Optional fields
82 - // lastid automatically sets ids and timestamp
83 - // because it needs them internally
84 - $this->fld_lastid = isset ($prop['lastid']);
85 - $this->fld_ids = isset ($prop['ids']) || $this->fld_lastid;
 82+ $this->fld_ids = isset ($prop['ids']);
8683 // $this->addFieldsIf('rev_text_id', $this->fld_ids); // should this be exposed?
8784 $this->fld_flags = $this->addFieldsIf('rev_minor_edit', isset ($prop['flags']));
88 - $this->fld_timestamp = $this->addFieldsIf('rev_timestamp', isset ($prop['timestamp']) || $this->fld_lastid);
 85+ $this->fld_timestamp = $this->addFieldsIf('rev_timestamp', isset ($prop['timestamp']));
8986 $this->fld_comment = $this->addFieldsIf('rev_comment', isset ($prop['comment']));
9087
9188 if (isset ($prop['user'])) {
@@ -183,21 +180,7 @@
184181 $this->setContinueEnumParameter('startid', intval($row->rev_id));
185182 break;
186183 }
187 - $rowArr = $this->extractRowInfo($row);
188184
189 - if($this->fld_lastid) {
190 - $this->resetQueryParams();
191 - $this->addTables('revision');
192 - $this->addFields('rev_id');
193 - $this->addWhereFld('rev_page', $rowArr['pageid']);
194 - $this->addWhere("rev_timestamp < '{$row->rev_timestamp}'");
195 - $this->addOption('LIMIT', 1);
196 - $this->addOption('ORDER BY', 'rev_timestamp DESC');
197 - $res2 = $this->select(__METHOD__);
198 - $row2 = $db->fetchObject($res2);
199 - $rowArr['lastid'] = $row2->rev_id;
200 - }
201 -
202185 $this->getResult()->addValue(
203186 array (
204187 'query',
@@ -205,7 +188,7 @@
206189 intval($row->rev_page),
207190 'revisions'),
208191 null,
209 - $rowArr);
 192+ $this->extractRowInfo($row));
210193 }
211194 $db->freeResult($res);
212195
@@ -262,7 +245,6 @@
263246 ApiBase :: PARAM_DFLT => 'ids|timestamp|flags|comment|user',
264247 ApiBase :: PARAM_TYPE => array (
265248 'ids',
266 - 'lastid',
267249 'flags',
268250 'timestamp',
269251 'user',

Follow-up revisions

RevisionCommit summaryAuthorDate
r23662Merged revisions 23581-23661 via svnmerge from...david03:01, 3 July 2007
r23982Removed incorrect line - bug 10297 is still open.yurik00:20, 11 July 2007
r24096Merged revisions 23910-24094 via svnmerge from...david22:38, 14 July 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23531Remove ?>'s from files. They're pointless, and just asking for people to mes...simetrical01:19, 29 June 2007
r23584Adding rvprop=lastid parameter to prop=revisions that lists revid of...catrope09:23, 30 June 2007

Status & tagging log