From 8a1f37198cd9ffc31fa265e1801c650aba528e5c Mon Sep 17 00:00:00 2001 From: Banana Date: Sat, 25 Nov 2023 11:57:56 +0100 Subject: [PATCH] fixed #23 basic search result order --- CHANGELOG | 1 + webclient/lib/mancubus.class.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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( -- 2.39.5