r79348 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79347‎ | r79348 | r79349 >
Date:16:44, 31 December 2010
Author:reedy
Status:ok
Tags:
Comment:
* (bug 25502) start parameter of list=coderevisions isn't right
Modified paths:
  • /trunk/extensions/CodeReview/api/ApiQueryCodeRevisions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/api/ApiQueryCodeRevisions.php
@@ -67,7 +67,7 @@
6868
6969 } else {
7070 if ( !is_null( $params['start'] ) ) {
71 - $pager->setOffset( $this->getDB()->timestamp( $params['start'] ) );
 71+ $pager->setOffset( $params['start'] );
7272 }
7373 $limit = $params['limit'];
7474 $pager->setLimit( $limit );
@@ -78,16 +78,16 @@
7979 }
8080
8181 $count = 0;
82 - $lastTimestamp = 0;
 82+ $lastId = 0;
8383 foreach ( $revisions as $row ) {
8484 if ( !$revsSet && $count == $limit ) {
8585 $this->setContinueEnumParameter( 'start',
86 - wfTimestamp( TS_ISO_8601, $lastTimestamp ) );
 86+ $lastId );
8787 break;
8888 }
8989
9090 $data[] = $this->formatRow( $row );
91 - $lastTimestamp = $row->cr_timestamp;
 91+ $lastId = $row->cr_id;
9292 $count++;
9393 }
9494
@@ -136,7 +136,7 @@
137137 ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
138138 ),
139139 'start' => array(
140 - ApiBase::PARAM_TYPE => 'timestamp'
 140+ ApiBase::PARAM_TYPE => 'integer'
141141 ),
142142 'revs' => array(
143143 ApiBase::PARAM_ISMULTI => true,

Follow-up revisions

RevisionCommit summaryAuthorDate
r79353Related to r79348, use $pager->getDefaultSort() to specify the start used by ...reedy17:00, 31 December 2010

Status & tagging log