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