r47036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47035‎ | r47036 | r47037 >
Date:13:28, 9 February 2009
Author:catrope
Status:deferred
Tags:
Comment:
Fix some more regressions from r46845 reported by Brad Jorsch on the mediawiki-api list <http://lists.wikimedia.org/pipermail/mediawiki-api/2009-February/000924.html&gt;
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllmessages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllLinks.php
@@ -127,8 +127,10 @@
128128 $fit = $result->addValue(array('query', $this->getModuleName()), null, $vals);
129129 if(!$fit)
130130 {
131 - $this->setContinueEnumParameter('continue',
132 - $this->keyToTitle($row->pl_title) . "|" . $row->pl_from);
 131+ if($params['unique'])
 132+ $this->setContinueEnumParameter('from', $this->keyToTitle($row->pl_title));
 133+ else
 134+ $this->setContinueEnumParameter('continue', $this->keyToTitle($row->pl_title) . "|" . $row->pl_from);
133135 break;
134136 }
135137 } else {
Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -229,7 +229,11 @@
230230 }
231231 if(!$fit)
232232 {
233 - $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp));
 233+ if($mode == 'all')
 234+ $this->setContinueEnumParameter('continue', $this->keyToTitle($row->ar_title) . '|' .
 235+ $row->ar_timestamp);
 236+ else
 237+ $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->ar_timestamp));
234238 break;
235239 }
236240 }
Index: trunk/phase3/includes/api/ApiQueryAllmessages.php
@@ -76,7 +76,7 @@
7777 $messages = array();
7878 foreach( $messages_target as $message ) {
7979 if(!is_null($params['from']))
80 - if($message < $params['from'])
 80+ if($message != $params['from'])
8181 continue;
8282 $messages[$message] = wfMsg( $message );
8383 }
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -231,8 +231,8 @@
232232 ApiBase :: dieDebug(__METHOD__, 'param validation?');
233233
234234 $this->addOption('LIMIT', $limit +1);
235 - if(!is_null($continue))
236 - $this->addOption('OFFSET', $continue);
 235+ if(!is_null($params['continue']))
 236+ $this->addOption('OFFSET', $params['continue']);
237237
238238 $data = array ();
239239 $count = 0;
@@ -256,7 +256,7 @@
257257 if($enumRevMode)
258258 $this->setContinueEnumParameter('startid', intval($row->rev_id));
259259 else
260 - $this->setContinueEnumParameter('continue', $continue + $count - 1);
 260+ $this->setContinueEnumParameter('continue', $params['continue'] + $count - 1);
261261 break;
262262 }
263263 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46845* API: BREAKING CHANGE: (bug 11430) Return fewer results than the limit in so...catrope14:30, 5 February 2009

Status & tagging log