mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added double-checks for associations when a potential failure is detected
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28974 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -167,6 +167,17 @@ public class AssocSourceMultiplicityIntegrityEvent extends AbstractIntegrityEven
|
||||
|
||||
if ((mandatory && actualSize == 0) || (!allowMany && actualSize > 1))
|
||||
{
|
||||
if (actualSize == 0)
|
||||
{
|
||||
// Double check that the association source is still present
|
||||
ClassDefinition classDef = assocDef.getTargetClass();
|
||||
if (classDef.isAspect() && !nodeService.hasAspect(targetNodeRef, classDef.getName()))
|
||||
{
|
||||
// The target is an aspect but the aspect is not present
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
String parentOrSourceStr = (assocDef.isChild() ? "parent" : "source");
|
||||
IntegrityRecord result = new IntegrityRecord(
|
||||
"The association " + parentOrSourceStr + " multiplicity has been violated: \n" +
|
||||
|
Reference in New Issue
Block a user