From ca3bfc865a07f5735846cd9405df9e64386f6b2a Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Tue, 11 Dec 2012 17:31:00 -0800 Subject: [PATCH] CSPACE-5727: Exclude non-active (e.g. soft-deleted, versioned) Movement records when computing the current location of a CollectionObject. --- .../services/listener/UpdateObjectLocationOnMove.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java index 8a08140d6..3ba9e9a85 100644 --- a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java +++ b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java @@ -371,6 +371,12 @@ public class UpdateObjectLocationOnMove implements EventListener { csid = (String) relatedDocModel.getProperty(RELATIONS_COMMON_SCHEMA, OBJECT_CSID_PROPERTY); } movementDocModel = getDocModelFromCsid(session, csid); + // Verify that the Movement record is active. This will also exclude + // versioned Movement records from the computation of the current + // location, for tenants that are versioning such records. + if (!isActiveDocument(movementDocModel)) { + continue; + } GregorianCalendar locationDate = (GregorianCalendar) movementDocModel.getProperty(MOVEMENTS_COMMON_SCHEMA, LOCATION_DATE_PROPERTY); if (locationDate == null) { -- 2.47.3