From: Sam Reed Date: Sun, 13 Mar 2011 19:28:44 +0000 (+0000) Subject: Followup r83843, r83837, per brian, addOption unconditionally replaces ORDER BY etc... X-Git-Tag: 1.31.0-rc.0~31451 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=a463facbd584c88b07b0e2f4638d03f87bd6d238;p=lhc%2Fweb%2Fwiklou.git Followup r83843, r83837, per brian, addOption unconditionally replaces ORDER BY etc, so fix that Simplify addFields call, remove un-needed array for 1 element --- diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 4b40ffb6de..1a7ad616c5 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -102,9 +102,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { $this->addWhere( 'pl_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); } - $this->addFields( array( - 'pl_title', - ) ); + $this->addFields( 'pl_title' ); $this->addFieldsIf( 'pl_from', !$params['unique'] ); $this->addOption( 'USE INDEX', 'pl_namespace' ); @@ -112,7 +110,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { $this->addOption( 'LIMIT', $limit + 1 ); if ( !$params['unique'] ) { - $this->addOption( 'ORDER BY', 'pl_from' ); + $this->addOption( 'ORDER BY', 'pl_title, pl_from' ); } $res = $this->select( __METHOD__ ); diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 2cf5ee5788..290f4d7b3f 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -172,7 +172,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { if ( $params['unique'] ) { $this->addOption( 'GROUP BY', 'ar_title' ); } else { - $this->addOption( 'ORDER BY', 'ar_timestamp' ); + $this->addOption( 'ORDER BY', 'ar_title, ar_timestamp' ); } } else { if ( $mode == 'revs' ) {