You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/01/01 23:02:17 UTC

svn commit: r1554685 - in /ofbiz/trunk/framework/minilang: dtd/simple-methods-v2.xsd src/org/ofbiz/minilang/method/envops/SetOperation.java

Author: jleroux
Date: Wed Jan  1 22:02:17 2014
New Revision: 1554685

URL: http://svn.apache.org/r1554685
Log:
Completes "Set field in (at least) widget screen does not take into account a locale for (at least) the Float type" https://issues.apache.org/jira/browse/OFBIZ-5453 for minilang.
Removes dead code.
Locale applies only when the type is also passed, like in widgets.


Modified:
    ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd
    ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java

Modified: ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd?rev=1554685&r1=1554684&r2=1554685&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd (original)
+++ ofbiz/trunk/framework/minilang/dtd/simple-methods-v2.xsd Wed Jan  1 22:02:17 2014
@@ -1222,7 +1222,7 @@ under the License.
                 <xs:annotation>
                     <xs:documentation>
                         A locale value (eg: en). The locale allows to pass values whose types are locale dependent (like Float, etc.).
-                        Defaults to the environment locale.
+                        Defaults to the environment locale. Works only if a type which makes sense is also passed.                        
                         
                         Optional. Attribute types: constant, ${expression}.
                     </xs:documentation>

Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java?rev=1554685&r1=1554684&r2=1554685&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java (original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/envops/SetOperation.java Wed Jan  1 22:02:17 2014
@@ -144,8 +144,7 @@ public final class SetOperation extends 
                 Debug.logWarning(exc, "Error evaluating scriptlet [" + this.scriptlet + "]: " + exc, module);
             }
         } else if (!this.fromFma.isEmpty()) {
-            Locale locale = methodContext.getLocale();
-            if (!this.localeFse.isEmpty()) {
+            if (!this.localeFse.isEmpty() && this.type.length() > 0) {
                 methodContext.setLocale(new Locale(this.localeFse.expandString(methodContext.getEnvMap())));
             }
             newValue = this.fromFma.get(methodContext.getEnvMap());