Author: sichen
Date: Wed Oct 10 16:33:22 2007
New Revision: 583642

URL: http://svn.apache.org/viewvc?rev=583642&view=rev
Log:
fix a potential bug where an unrelated contactMechId might be assigned to 
Shipment.destinationTelecomNumberId if there are no phone numbers for a facility

Modified:
    
ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

Modified: 
ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?rev=583642&r1=583641&r2=583642&view=diff
==============================================================================
--- 
ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
 (original)
+++ 
ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
 Wed Oct 10 16:33:22 2007
@@ -572,8 +572,12 @@
                 <set value="PHONE_SHIPPING" 
field="findFcmpMap.contactMechPurposeTypeId"/>
                 <find-by-and entity-name="FacilityContactMechPurpose" 
map-name="findFcmpMap" order-by-list-name="descendingFromDateOrder" 
list-name="facilityContactMechPurposes"/>
                 <filter-list-by-date list-name="facilityContactMechPurposes"/>
-                <first-from-list entry-name="facilityContactMechPurpose" 
list-name="facilityContactMechPurposes"/>
-                <set from-field="facilityContactMechPurpose.contactMechId" 
field="shipment.destinationTelecomNumberId"/>
+                <!-- This check is necessary or some random contactMechId 
might be filled in by minilang, possibly from another call earlier, if 
facilityContactMechPurpoess is indeed null.
+                It should probably be implemented for all of the above but I 
have not had a chance to test it. (Si) -->
+                <if-not-empty field-name="facilityContactMechPurposes">
+                    <first-from-list entry-name="facilityContactMechPurpose" 
list-name="facilityContactMechPurposes"/>
+                    <set from-field="facilityContactMechPurpose.contactMechId" 
field="shipment.destinationTelecomNumberId"/>
+                </if-not-empty>
             </if-empty>
         </if-not-empty>
 


Reply via email to