From 00a5f59bc3e471b87da919ed01b23996143e6708 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 23 Jul 2025 20:07:35 +0200 Subject: [PATCH] check if attr definition exists when building a search query --- out/out.Search.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/out/out.Search.php b/out/out.Search.php index 3aaf8df99..d2de6d74c 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -535,16 +535,17 @@ if($fullsearch) { $attributes = array(); foreach($attributes as $attrdefid=>$attribute) { - $attrdef = $dms->getAttributeDefinition($attrdefid); if($attribute) { - if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { - if(is_array($attribute)) { - if(!empty($attributes[$attrdefid]['from'])) - $attributes[$attrdefid]['from'] = date('Y-m-d', makeTsFromDate($attribute['from'])); - if(!empty($attributes[$attrdefid]['to'])) - $attributes[$attrdefid]['to'] = date('Y-m-d', makeTsFromDate($attribute['to'])); - } else { - $attributes[$attrdefid] = date('Y-m-d', makeTsFromDate($attribute)); + if($attrdef = $dms->getAttributeDefinition($attrdefid)) { + if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { + if(is_array($attribute)) { + if(!empty($attributes[$attrdefid]['from'])) + $attributes[$attrdefid]['from'] = date('Y-m-d', makeTsFromDate($attribute['from'])); + if(!empty($attributes[$attrdefid]['to'])) + $attributes[$attrdefid]['to'] = date('Y-m-d', makeTsFromDate($attribute['to'])); + } else { + $attributes[$attrdefid] = date('Y-m-d', makeTsFromDate($attribute)); + } } } }