]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
fixing #13
authorBanana <mail@bananas-playground.net>
Fri, 16 Dec 2022 17:41:35 +0000 (18:41 +0100)
committerBanana <mail@bananas-playground.net>
Fri, 16 Dec 2022 17:41:35 +0000 (18:41 +0100)
webclient/lib/mancubus.class.php

index 9ddb5be6a7b95dc917b8916ff8bc916a48833dee..472e44d89f59e3bbf04731914e52118bc2a25340 100644 (file)
@@ -146,18 +146,25 @@ class Mancubus {
                                                $_colObj = new Trite($this->_DB,$this->_User);
                                                $_colObj->load($result['id']);
                                                $_fd = $_colObj->getCollectionFields();
-
-                                               $result['entries'] = $_mObj->getEntries(
-                                                       array(
-                                                               0 => array(
-                                                                       'colName' => $_colObj->param('defaultSearchField'),
-                                                                       'colValue' => $search,
-                                                                       'fieldData' => $_fd[$_colObj->param('defaultSearchField')]
+                                               $_defSearchField = $_colObj->param('defaultSearchField');
+
+                                               if(!empty($_defSearchField)) {
+                                                       $result['entries'] = $_mObj->getEntries(
+                                                               array(
+                                                                       0 => array(
+                                                                               'colName' => $_defSearchField,
+                                                                               'colValue' => $search,
+                                                                               'fieldData' => $_fd[$_defSearchField]
+                                                                       )
                                                                )
-                                                       )
-                                               );
+                                                       );
+                                               }
+                                               else {
+                                                       error_log("[WARN] ".__METHOD__." missing default search field for collectionid: ".$result['id']);
+                                               }
                                        }
                                        else {
+
                                                $result['entries'] = $_mObj->getEntries();
                                        }
                                        $ret[$result['id']] = $result;