[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

@@ -10,7 +10,7 @@
parent="rm.parentModulePatch" parent="rm.parentModulePatch"
class="org.alfresco.module.org_alfresco_module_rm.patch.v35.RMv35HoldNewChildAssocPatch"> class="org.alfresco.module.org_alfresco_module_rm.patch.v35.RMv35HoldNewChildAssocPatch">
<property name="description" value="Create new hold child association to link the record to the hold"/> <property name="description" value="Create new hold child association to link the record to the hold"/>
<property name="fixesFromSchema" value="3201" /> <property name="fixesFromSchema" value="2400" />
<property name="fixesToSchema" value="3500"/> <property name="fixesToSchema" value="3500"/>
<property name="behaviourFilter" ref="policyBehaviourFilter" /> <property name="behaviourFilter" ref="policyBehaviourFilter" />
<property name="filePlanService" ref="filePlanService" /> <property name="filePlanService" ref="filePlanService" />

View File

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