- Fixed bug raised on forum that category values can be applied more than once.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2156 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2006-01-20 11:06:44 +00:00
parent aed399f1cd
commit 8b0fa4a821

View File

@@ -131,8 +131,11 @@ public class LinkCategoryActionExecuter extends ActionExecuterAbstractBase
// Append the category value to the existing values
Serializable value = this.nodeService.getProperty(actionedUponNodeRef, categoryProperty);
Collection<NodeRef> categories = DefaultTypeConverter.INSTANCE.getCollection(NodeRef.class, value);
categories.add(categoryValue);
this.nodeService.setProperty(actionedUponNodeRef, categoryProperty, (Serializable)categories);
if (categories.contains(categoryValue) == false)
{
categories.add(categoryValue);
this.nodeService.setProperty(actionedUponNodeRef, categoryProperty, (Serializable)categories);
}
}
}
}