From 472caa19bacc929a3cec99829f3b32239834add5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 24 Jun 2020 21:15:33 +0200 Subject: [PATCH] check if attributesversion has a value --- controllers/class.AddDocument.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/controllers/class.AddDocument.php b/controllers/class.AddDocument.php index 2b9942c86..370cfb253 100644 --- a/controllers/class.AddDocument.php +++ b/controllers/class.AddDocument.php @@ -74,19 +74,20 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common { } } } - $attributes_version = $this->getParam('attributesversion'); - foreach($attributes_version as $attrdefid=>$attribute) { - if($attrdef = $dms->getAttributeDefinition($attrdefid)) { - if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) { - if($attribute) { - if(!$attrdef->validate($attribute)) { - $this->errormsg = getAttributeValidationError($attrdef->getValidationError(), $attrdef->getName(), $attribute); - return false; + if($attributes_version = $this->getParam('attributesversion')) { + foreach($attributes_version as $attrdefid=>$attribute) { + if($attrdef = $dms->getAttributeDefinition($attrdefid)) { + if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) { + if($attribute) { + if(!$attrdef->validate($attribute)) { + $this->errormsg = getAttributeValidationError($attrdef->getValidationError(), $attrdef->getName(), $attribute); + return false; + } + } + } else { + if($ret === false) + return false; } - } - } else { - if($ret === false) - return false; } } }