From d1829dfe29c4c1278d895c3f76a46ff4b9d39459 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 6 Mar 2017 13:47:38 +0100 Subject: [PATCH] fix import of object type of attribute definitions --- utils/xmlimport.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/xmlimport.php b/utils/xmlimport.php index c2290359c..1a92a906d 100644 --- a/utils/xmlimport.php +++ b/utils/xmlimport.php @@ -203,7 +203,8 @@ function insert_attributedefinition($attrdef) { /* {{{ */ $logger->info("Attribute definition already exists"); } else { if(in_array('attributedefinitions', $sections)) { - if(!$newAttrdef = $dms->addAttributeDefinition($attrdef['attributes']['name'], $attrdef['objecttype'], $attrdef['attributes']['type'], $attrdef['attributes']['multiple'], $attrdef['attributes']['minvalues'], $attrdef['attributes']['maxvalues'], $attrdef['attributes']['valueset'], $attrdef['attributes']['regex'])) { + $objtype = ($attrdef['objecttype'] == 'folder' ? SeedDMS_Core_AttributeDefinition::objtype_folder : ($attrdef['objecttype'] == 'document' ? SeedDMS_Core_AttributeDefinition::objtype_document : ($attrdef['objecttype'] == 'documentcontent' ? SeedDMS_Core_AttributeDefinition::objtype_documentcontent : 0))); + if(!$newAttrdef = $dms->addAttributeDefinition($attrdef['attributes']['name'], $objtype, $attrdef['attributes']['type'], $attrdef['attributes']['multiple'], $attrdef['attributes']['minvalues'], $attrdef['attributes']['maxvalues'], $attrdef['attributes']['valueset'], $attrdef['attributes']['regex'])) { $logger->err("Could not add attribute definition"); $logger->debug($dms->getDB()->getErrorMsg()); return false;