]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5727: Exclude non-active (e.g. soft-deleted, versioned) Movement records when...
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 12 Dec 2012 01:31:00 +0000 (17:31 -0800)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 12 Dec 2012 01:31:00 +0000 (17:31 -0800)
3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java

index 8a08140d6e7f35cb563c76bc5d20a24f030eafb5..3ba9e9a85ad7032eadad9554cfb88dc1d4aed49c 100644 (file)
@@ -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) {