From: Aron Roberts Date: Fri, 15 Feb 2013 00:30:59 +0000 (-0800) Subject: CSPACE-5887: Update event listener with updated logic also used in PAHMA-734. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=4017ffc4a22970f1ff032218f122f18fcb5301a5;p=tmp%2Fjakarta-migration.git CSPACE-5887: Update event listener with updated logic also used in PAHMA-734. --- 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 3436d3c19..c7ff0a336 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 @@ -64,10 +64,12 @@ public class UpdateObjectLocationOnMove extends AbstractUpdateObjectLocationValu if (Tools.isBlank(currentLocationRefName) && Tools.notBlank(existingComputedCurrentLocationRefName)) { collectionObjectDocModel.setProperty(COLLECTIONOBJECTS_COMMON_SCHEMA, COMPUTED_CURRENT_LOCATION_PROPERTY, (Serializable) null); - // Otherwise, if the existing value is blank, or if the new value - // is different than the existing value ... - } else if (Tools.isBlank(existingComputedCurrentLocationRefName) - || (!currentLocationRefName.equals(existingComputedCurrentLocationRefName))) { + // Otherwise, if the new value is not blank, and + // * the existing value is blank, or + // * the new value is different than the existing value ... + } else if (Tools.notBlank(currentLocationRefName) && + (Tools.isBlank(existingComputedCurrentLocationRefName) + || !currentLocationRefName.equals(existingComputedCurrentLocationRefName))) { if (logger.isTraceEnabled()) { logger.trace("computedCurrentLocation refName requires updating."); } diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml index c45d2138e..6a1faeebd 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml @@ -374,6 +374,40 @@ --> + + PUT + /cspace-services/movements/${createMovement2.CSID} + listener/movement.xml + + + 1800-02-01 + + 200 + + + + + PUT /cspace-services/movements/${createMovement2.CSID}