mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-6926 Don't trigger onUpdateProperties policy when a frozen node is added to another hold
This commit is contained in:
@@ -587,6 +587,8 @@ public class HoldServiceImpl extends ServiceBaseImpl
|
||||
addFrozenAspect(nodeRef, props);
|
||||
|
||||
// Link the record to the hold
|
||||
//set in transaction cache in order not to trigger update policy when adding the association
|
||||
transactionalResourceHelper.getSet("frozen").add(nodeRef);
|
||||
nodeService.addChild(hold, nodeRef, ASSOC_FROZEN_RECORDS, ASSOC_FROZEN_RECORDS);
|
||||
|
||||
// audit item being added to the hold
|
||||
|
@@ -245,4 +245,40 @@ public class AddActiveContentToHoldTest extends BaseRMTestCase
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Given active content on hold
|
||||
* When I try to add content to another hold
|
||||
* And I have file permission on the other hold
|
||||
* And I have the appropriate capability to add to hold
|
||||
* Then the active content is contained within both holds
|
||||
* And the active content remains frozen
|
||||
*/
|
||||
public void testAddDocumentToAnotherHold()
|
||||
{
|
||||
doBehaviourDrivenTest(new BehaviourDrivenTest()
|
||||
{
|
||||
private NodeRef hold;
|
||||
private NodeRef hold2;
|
||||
|
||||
public void given()
|
||||
{
|
||||
hold = holdService.createHold(filePlan, GUID.generate(), GUID.generate(), GUID.generate());
|
||||
hold2 = holdService.createHold(filePlan, GUID.generate(), GUID.generate(), GUID.generate());
|
||||
holdService.addToHold(hold, dmDocument);
|
||||
}
|
||||
|
||||
public void when()
|
||||
{
|
||||
holdService.addToHold(hold2, dmDocument);
|
||||
}
|
||||
|
||||
public void then()
|
||||
{
|
||||
assertTrue(freezeService.isFrozen(dmDocument));
|
||||
assertTrue(holdService.heldBy(dmDocument, true).contains(hold));
|
||||
assertTrue(holdService.heldBy(dmDocument, true).contains(hold2));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user