Author: jleroux
Date: Thu Jan 2 11:15:00 2014 New Revision: 1554788 URL: http://svn.apache.org/r1554788 Log: "Applied fix from trunk for revision: 1554787" ------------------------------------------------------------------------ r1554787 | jleroux | 2014-01-02 12:14:01 +0100 (jeu. 02 janv. 2014) | 1 ligne I did not get a chance to test my last editGeoLocation related change, here is the definitive version ------------------------------------------------------------------------ Modified: ofbiz/branches/release13.07/ (props changed) ofbiz/branches/release13.07/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml ofbiz/branches/release13.07/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java Propchange: ofbiz/branches/release13.07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1554787 Modified: ofbiz/branches/release13.07/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml?rev=1554788&r1=1554787&r2=1554788&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml (original) +++ ofbiz/branches/release13.07/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml Thu Jan 2 11:15:00 2014 @@ -128,8 +128,8 @@ under the License. <simple-method method-name="editGeoLocation" short-description="Edit GeoLocation"> <if-empty field="parameters.geoPointId"> <set field="createGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/> - <set field="createGeoPointMap.latitude" from-field="parameters.lat" locale="en"/> - <set field="createGeoPointMap.longitude" from-field="parameters.lng" locale="en"/> + <set field="createGeoPointMap.latitude" from-field="parameters.lat" type="Double" locale="en"/> + <set field="createGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/> <call-service service-name="createGeoPoint" in-map-name="createGeoPointMap"> <result-to-field result-name="geoPointId" field="geoPointId"/> </call-service> @@ -143,8 +143,8 @@ under the License. <else> <set field="updateGeoPointMap.geoPointId" from-field="parameters.geoPointId"/> <set field="updateGeoPointMap.dataSourceId" value="GEOPT_GOOGLE"/> - <set field="updateGeoPointMap.latitude" from-field="parameters.lat" locale="en"/> - <set field="updateGeoPointMap.longitude" from-field="parameters.lng" locale="en"/> + <set field="updateGeoPointMap.latitude" from-field="parameters.lat" type="Double" locale="en"/> + <set field="updateGeoPointMap.longitude" from-field="parameters.lng" type="Double" locale="en"/> <call-service service-name="updateGeoPoint" in-map-name="updateGeoPointMap"/> </else> </if-empty> Modified: ofbiz/branches/release13.07/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java?rev=1554788&r1=1554787&r2=1554788&view=diff ============================================================================== --- ofbiz/branches/release13.07/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java (original) +++ ofbiz/branches/release13.07/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java Thu Jan 2 11:15:00 2014 @@ -187,7 +187,12 @@ public final class SetOperation extends if (targetClass == null) { targetClass = MiniLangUtil.getObjectClassForConversion(newValue); } - newValue = MiniLangUtil.convertType(newValue, targetClass, methodContext.getLocale(), methodContext.getTimeZone(), format); + if (!this.localeFse.isEmpty() && this.type.length() > 0) {// FIXME this is a temporary hack waiting for a better geolocation data model, related with OFBIZ-5453 + Locale localeTemp = new Locale(this.localeFse.expandString(methodContext.getEnvMap())); + newValue = MiniLangUtil.convertType(newValue, targetClass, localeTemp, methodContext.getTimeZone(), format); + } else { + newValue = MiniLangUtil.convertType(newValue, targetClass, methodContext.getLocale(), methodContext.getTimeZone(), format); + } } catch (Exception e) { String errMsg = "Could not convert field value for the field: [" + this.fieldFma.toString() + "] to the [" + this.type + "] type for the value [" + newValue + "]: " + e.getMessage(); Debug.logWarning(e, errMsg, module); |
Free forum by Nabble | Edit this page |