]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
fixed #23 basic search result order
authorBanana <mail@bananas-playground.net>
Sat, 25 Nov 2023 10:57:56 +0000 (11:57 +0100)
committerBanana <mail@bananas-playground.net>
Sat, 25 Nov 2023 10:57:56 +0000 (11:57 +0100)
CHANGELOG
webclient/lib/mancubus.class.php

index 64b9a169fc3dbb473a0bdf7ce4ffed006db11338..2a2c3eac0100f0a828f630865868050be483c072 100644 (file)
--- 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.
index 2dfe64f808e6146ac9930a62efb031b33ab915ce..ac29ef6554ef1b4cd777b1826ce5dc3b62f30b1d 100644 (file)
@@ -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(