From 2c77f51c62262038e1ef249c3a31118ae55861e9 Mon Sep 17 00:00:00 2001 From: Banana Date: Fri, 16 Dec 2022 18:41:35 +0100 Subject: [PATCH] fixing #13 --- webclient/lib/mancubus.class.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/webclient/lib/mancubus.class.php b/webclient/lib/mancubus.class.php index 9ddb5be..472e44d 100644 --- a/webclient/lib/mancubus.class.php +++ b/webclient/lib/mancubus.class.php @@ -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; -- 2.39.5