ApiQueryBase.php: Allow queries to have a where range that does not match the range...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 17 Feb 2008 18:43:31 +0000 (18:43 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sun, 17 Feb 2008 18:43:31 +0000 (18:43 +0000)
RELEASE-NOTES
includes/api/ApiQueryBase.php

index a693362..006c6af 100644 (file)
@@ -540,6 +540,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Added siprop=namespacealiases to meta=siteinfo
 * Made multiple values for ucuser possible in list=usercontribs
 * (bug 12944) Added cmstart and cmend parameters to list=categorymembers
+* Allow queries to have a where range that does not match the range field
 
 === Languages updated in 1.12 ===
 
index 69492db..f964ea9 100644 (file)
@@ -110,8 +110,9 @@ abstract class ApiQueryBase extends ApiBase {
 
                if (!is_null($end))
                        $this->addWhere($field . $before . $db->addQuotes($end));
-
-               $this->addOption('ORDER BY', $field . ($isDirNewer ? '' : ' DESC'));
+               
+               if (!isset($this->options['ORDER BY']))
+                       $this->addOption('ORDER BY', $field . ($isDirNewer ? '' : ' DESC'));
        }
 
        protected function addOption($name, $value = null) {