Index: branches/apiedit/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | parent :: __construct($query, $moduleName, 'rv'); |
43 | 43 | } |
44 | 44 | |
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, |
46 | 46 | $fld_comment = false, $fld_user = false, $fld_content = false; |
47 | 47 | |
48 | 48 | public function execute() { |
— | — | @@ -78,13 +78,10 @@ |
79 | 79 | $this->addFields('rev_page'); |
80 | 80 | |
81 | 81 | // 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']); |
86 | 83 | // $this->addFieldsIf('rev_text_id', $this->fld_ids); // should this be exposed? |
87 | 84 | $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'])); |
89 | 86 | $this->fld_comment = $this->addFieldsIf('rev_comment', isset ($prop['comment'])); |
90 | 87 | |
91 | 88 | if (isset ($prop['user'])) { |
— | — | @@ -185,20 +182,6 @@ |
186 | 183 | } |
187 | 184 | $rowArr = $this->extractRowInfo($row); |
188 | 185 | |
189 | | - if($this->fld_lastid) { |
190 | | - // Queries in loops are EVIL, FIXME |
191 | | - $this->resetQueryParams(); |
192 | | - $this->addTables('revision'); |
193 | | - $this->addFields('rev_id'); |
194 | | - $this->addWhereFld('rev_page', $rowArr['pageid']); |
195 | | - $this->addWhere("rev_timestamp < '{$row->rev_timestamp}'"); |
196 | | - $this->addOption('LIMIT', 1); |
197 | | - $this->addOption('ORDER BY', 'rev_timestamp DESC'); |
198 | | - $res2 = $this->select(__METHOD__); |
199 | | - $row2 = $db->fetchObject($res2); |
200 | | - $rowArr['lastid'] = $row2->rev_id; |
201 | | - } |
202 | | - |
203 | 186 | $this->getResult()->addValue( |
204 | 187 | array ( |
205 | 188 | 'query', |
— | — | @@ -263,7 +246,6 @@ |
264 | 247 | ApiBase :: PARAM_DFLT => 'ids|timestamp|flags|comment|user', |
265 | 248 | ApiBase :: PARAM_TYPE => array ( |
266 | 249 | 'ids', |
267 | | - 'lastid', |
268 | 250 | 'flags', |
269 | 251 | 'timestamp', |
270 | 252 | 'user', |