mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 21:51:32 +00:00
check if attributesversion has a value
This commit is contained in:
parent
994b207f2b
commit
472caa19ba
|
@ -74,19 +74,20 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$attributes_version = $this->getParam('attributesversion');
|
if($attributes_version = $this->getParam('attributesversion')) {
|
||||||
foreach($attributes_version as $attrdefid=>$attribute) {
|
foreach($attributes_version as $attrdefid=>$attribute) {
|
||||||
if($attrdef = $dms->getAttributeDefinition($attrdefid)) {
|
if($attrdef = $dms->getAttributeDefinition($attrdefid)) {
|
||||||
if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) {
|
if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) {
|
||||||
if($attribute) {
|
if($attribute) {
|
||||||
if(!$attrdef->validate($attribute)) {
|
if(!$attrdef->validate($attribute)) {
|
||||||
$this->errormsg = getAttributeValidationError($attrdef->getValidationError(), $attrdef->getName(), $attribute);
|
$this->errormsg = getAttributeValidationError($attrdef->getValidationError(), $attrdef->getName(), $attribute);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if($ret === false)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if($ret === false)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user