From 82f93e6ae1106513b6d18dc3a4a55f55a20276ed Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 1 Nov 2006 15:49:34 +0000 Subject: [PATCH] API * Minor fixes to user contribs and logevents. Paging is still broken. --- includes/api/ApiQueryContributions.php | 11 +++-------- includes/api/ApiQueryLogEvents.php | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/includes/api/ApiQueryContributions.php b/includes/api/ApiQueryContributions.php index f040998417..60b140ecd1 100644 --- a/includes/api/ApiQueryContributions.php +++ b/includes/api/ApiQueryContributions.php @@ -38,7 +38,7 @@ class ApiQueryContributions extends ApiQueryBase { public function execute() { //Blank all our variables - $limit = $user = $start = $end = $user = null; + $limit = $user = $start = $end = $dir = null; //Get our parameters out extract($this->extractRequestParams()); @@ -55,9 +55,6 @@ class ApiQueryContributions extends ApiQueryBase { //Extract the table names, in case we have a prefix extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl'); - //STRAIGHT_JOIN option - $this->addOption('STRAIGHT_JOIN'); - //We're after the revision table, and the corresponding page row for //anything we retrieve. $this->addTables("$tbl_revision LEFT OUTER JOIN $tbl_page ON " . @@ -77,8 +74,6 @@ class ApiQueryContributions extends ApiQueryBase { $this->addOption('LIMIT', $limit + 1); - $this->addOption('ORDER BY', 'rev_timestamp DESC'); - //Initialise some variables $data = array (); $count = 0; @@ -90,7 +85,7 @@ class ApiQueryContributions extends ApiQueryBase { while ( $row = $db->fetchObject( $res ) ) { if (++ $count > $limit) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... - $this->setContinueEnumParameter('start', ApiQueryBase :: keyToTitle($row->rev_timestamp)); + $this->setContinueEnumParameter('start', $row->rev_timestamp); break; } @@ -125,7 +120,7 @@ class ApiQueryContributions extends ApiQueryBase { protected function getAllowedParams() { return array ( 'limit' => array ( - ApiBase :: PARAM_DFLT => 50, + ApiBase :: PARAM_DFLT => 10, ApiBase :: PARAM_TYPE => 'limit', ApiBase :: PARAM_MIN => 1, ApiBase :: PARAM_MAX1 => ApiBase :: LIMIT_BIG1, diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 93541d3eac..1f92fd6a8d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -88,7 +88,7 @@ class ApiQueryLogEvents extends ApiQueryBase { while ($row = $db->fetchObject($res)) { if (++ $count > $limit) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... - $this->setContinueEnumParameter('start', ApiQueryBase :: keyToTitle($row->log_timestamp)); + $this->setContinueEnumParameter('start', $row->log_timestamp); break; } -- 2.20.1