From: Banana Date: Sat, 25 Nov 2023 10:57:56 +0000 (+0100) Subject: fixed #23 basic search result order X-Git-Tag: 1.6~16 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=8a1f37198cd9ffc31fa265e1801c650aba528e5c;p=bibliotheca-php.git fixed #23 basic search result order --- diff --git a/CHANGELOG b/CHANGELOG index 64b9a16..2a2c3ea 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ * Fixed: #22 98 theme. Attachment selection checkbox are not all selectable * Fixed: #26 98 theme. max column with * Fixed: #25 98 design. Sort direction select does not show the correct selected option + * Fixed: #23 basic search result order 1.5 - Sacred Passage 2023-05-01 * Added google books parser. See upgrade file for more infos. diff --git a/webclient/lib/mancubus.class.php b/webclient/lib/mancubus.class.php index 2dfe64f..ac29ef6 100644 --- a/webclient/lib/mancubus.class.php +++ b/webclient/lib/mancubus.class.php @@ -141,7 +141,6 @@ class Mancubus { while(($result = $query->fetch_assoc()) != false) { $_mObj = new Mancubus($this->_DB,$this->_User); $_mObj->setCollection($result['id']); - $_mObj->setQueryOptions(array('limit' => $entries)); if(!empty($search)) { require_once 'lib/trite.class.php'; @@ -150,6 +149,13 @@ class Mancubus { $_fd = $_colObj->getCollectionFields(); $_defSearchField = $_colObj->param('defaultSearchField'); + $_mObj->setQueryOptions(array( + 'limit' => $entries, + 'sortDirection' => $_colObj->param('defaultSortOrder'), + 'sort' => $_colObj->param('defaultSortField') + )); + $_defSearchField = $_colObj->param('defaultSearchField'); + if(!empty($_defSearchField)) { $result['entries'] = $_mObj->getEntries( array(