Index: trunk/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'])) { |
— | — | @@ -183,21 +180,7 @@ |
184 | 181 | $this->setContinueEnumParameter('startid', intval($row->rev_id)); |
185 | 182 | break; |
186 | 183 | } |
187 | | - $rowArr = $this->extractRowInfo($row); |
188 | 184 | |
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 | | - |
202 | 185 | $this->getResult()->addValue( |
203 | 186 | array ( |
204 | 187 | 'query', |
— | — | @@ -205,7 +188,7 @@ |
206 | 189 | intval($row->rev_page), |
207 | 190 | 'revisions'), |
208 | 191 | null, |
209 | | - $rowArr); |
| 192 | + $this->extractRowInfo($row)); |
210 | 193 | } |
211 | 194 | $db->freeResult($res); |
212 | 195 | |
— | — | @@ -262,7 +245,6 @@ |
263 | 246 | ApiBase :: PARAM_DFLT => 'ids|timestamp|flags|comment|user', |
264 | 247 | ApiBase :: PARAM_TYPE => array ( |
265 | 248 | 'ids', |
266 | | - 'lastid', |
267 | 249 | 'flags', |
268 | 250 | 'timestamp', |
269 | 251 | 'user', |