From: Roan Kattouw Date: Wed, 5 Oct 2011 13:15:44 +0000 (+0000) Subject: Fix bug in r83814 reported on IRC: categorymembers did not set an ORDER BY when cmcon... X-Git-Tag: 1.31.0-rc.0~27261 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=0755cf92a153a566e89e700505bba1a3bd5993d6;p=lhc%2Fweb%2Fwiklou.git Fix bug in r83814 reported on IRC: categorymembers did not set an ORDER BY when cmcontinue was set, which broke paging when cmdir=desc was used. --- diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index c1871a5b41..cdbc29a5dd 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -143,7 +143,9 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase { $contWhere = "cl_sortkey $op $escSortkey OR " . "(cl_sortkey = $escSortkey AND " . "cl_from $op= $from)"; - + // The below produces ORDER BY cl_sortkey, cl_from, possibly with DESC added to each of them + $this->addWhereRange( 'cl_sortkey', $dir, null, null ); + $this->addWhereRange( 'cl_from', $dir, null, null ); } else { // The below produces ORDER BY cl_sortkey, cl_from, possibly with DESC added to each of them $this->addWhereRange( 'cl_sortkey',