fix a potential bug where an unrelated contactMechId might be assigned to Shipment.destinationTelecomNumberId if there are no phone numbers for a facility

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@583636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Si Chen
2007-10-10 22:36:33 +00:00
parent c8af171051
commit 97b47323f5
@@ -580,8 +580,12 @@ under the License.
<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>