mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +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');
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user