[Upgrade] Search Result points to incorrect link to Folder on Hold
This commit is contained in:
estan
2021-02-28 19:22:31 +02:00
parent a27e2aaa9e
commit e7f8862a7b
2 changed files with 5 additions and 4 deletions

View File

@@ -122,12 +122,13 @@ public class RMv35HoldNewChildAssocPatch extends AbstractModulePatch
ASSOC_FROZEN_CONTENT, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef ref : frozenAssoc)
{
NodeRef nodeRef = ref.getChildRef();
//search the second parent
List<ChildAssociationRef> parentAssoc = nodeService.getParentAssocs(ref.getChildRef(), ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
List<ChildAssociationRef> parentAssoc = nodeService.getParentAssocs(nodeRef, ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
if (parentAssoc.isEmpty())
{
ChildAssociationRef primaryParentAssoc = nodeService.getPrimaryParent(hold);
nodeService.addChild(hold, hold, ASSOC_CONTAINS, primaryParentAssoc.getQName());
ChildAssociationRef primaryParentAssoc = nodeService.getPrimaryParent(nodeRef);
nodeService.addChild(hold, nodeRef, ASSOC_CONTAINS, primaryParentAssoc.getQName());
}
}
}