From 23ab182801882a2ca42cde791b881c3771d42c89 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Mon, 16 Apr 2012 20:40:00 +0200 Subject: [PATCH] (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 --- includes/api/ApiQueryAllCategories.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() ) ); -- 2.20.1