Author: jleroux
Date: Thu Sep 9 15:04:14 2010
New Revision: 995453
URL:
http://svn.apache.org/viewvc?rev=995453&view=revLog:
A patch from Gil Portenseigne "Error while creating a facilityContactMech if no purpose is given" (
https://issues.apache.org/jira/browse/OFBIZ-3928) - OFBIZ-3928
Gil: When creating a new facility contactMech, a facilityContactMechPurpose is automatically created, even if there is no contactMechPurposeTypeId is given in parameters.
The problem is that it's impossible to create a FacilityContactMechPurpose without purpose, and contactMechPurposeTypeId is optional in service parameters.
JLR: so it makes sense if we don't want to change the service definition (ie make contactMechPurposeTypeId mandatory).
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml?rev=995453&r1=995452&r2=995453&view=diff==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml Thu Sep 9 15:04:14 2010
@@ -49,10 +49,12 @@ under the License.
<create-value value-field="newValue"/>
<!-- now create the FacilityContactMechPurpose record -->
- <make-value value-field="facilityContactMechPurpose" entity-name="FacilityContactMechPurpose"/>
- <set-pk-fields map="newValue" value-field="facilityContactMechPurpose"/>
- <set field="facilityContactMechPurpose.contactMechPurposeTypeId" from-field="parameters.contactMechPurposeTypeId"/>
- <create-value value-field="facilityContactMechPurpose"/>
+ <if-not-empty field="parameters.contactMechPurposeTypeId">
+ <make-value value-field="facilityContactMechPurpose" entity-name="FacilityContactMechPurpose"/>
+ <set-pk-fields map="newValue" value-field="facilityContactMechPurpose"/>
+ <set field="facilityContactMechPurpose.contactMechPurposeTypeId" from-field="parameters.contactMechPurposeTypeId"/>
+ <create-value value-field="facilityContactMechPurpose"/>
+ </if-not-empty>
</simple-method>
<simple-method method-name="updateFacilityContactMech" short-description="Update a FacilityContactMech">