mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
fix validating custom attribute of type 'date'
This commit is contained in:
parent
249e42f956
commit
4762b06741
|
@ -54,6 +54,11 @@ class SeedDMS_Controller_EditFolder extends SeedDMS_Controller_Common {
|
|||
$attrdef = $dms->getAttributeDefinition($attrdefid);
|
||||
if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) {
|
||||
if($attribute) {
|
||||
switch($attrdef->getType()) {
|
||||
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||
$attribute = date('Y-m-d', makeTsFromDate($attribute));
|
||||
break;
|
||||
}
|
||||
if(!$attrdef->validate($attribute, $folder, true)) {
|
||||
$this->errormsg = getAttributeValidationText($attrdef->getValidationError(), $attrdef->getName(), $attribute);
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user