From: Petr Onderka Date: Mon, 16 Apr 2012 18:40:00 +0000 (+0200) Subject: (bug 35855) fix min and max parameters in list=allcategories X-Git-Tag: 1.31.0-rc.0~23899 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=23ab182801882a2ca42cde791b881c3771d42c89;p=lhc%2Fweb%2Fwiklou.git (bug 35855) fix min and max parameters in list=allcategories API queries for list=allcategories with acdir=descending had the acmin and acmax parameters in reverse, that is min behaved like max and max behaved like min. This patch fixes the issue. Change-Id: If6346b682782856ffa5b15d08abd1b2ecc50424c --- diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 78367a45cd..ce28d03673 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -65,7 +65,12 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { $min = $params['min']; $max = $params['max']; - $this->addWhereRange( 'cat_pages', $dir, $min, $max ); + if ( $dir == 'newer' ) { + $this->addWhereRange( 'cat_pages', 'newer', $min, $max ); + } else { + $this->addWhereRange( 'cat_pages', 'older', $max, $min); + } + if ( isset( $params['prefix'] ) ) { $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );