svn commit: r1300202 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1300202 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java

jacopoc
Author: jacopoc
Date: Tue Mar 13 15:47:50 2012
New Revision: 1300202

URL: http://svn.apache.org/viewvc?rev=1300202&view=rev
Log:
The scripthelper object was created too early when the bindings were not set in the context; this caused the wrong scriptType to be set in the ContextHelper.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java?rev=1300202&r1=1300201&r2=1300202&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java Tue Mar 13 15:47:50 2012
@@ -224,12 +224,12 @@ public final class ScriptUtil {
         context.put(WIDGET_CONTEXT_KEY, context);
         context.put("context", context);
         ScriptContext scriptContext = new SimpleScriptContext();
+        Bindings bindings = new ProtectedBindings(context, Collections.unmodifiableSet(protectedKeys));
+        scriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
         ScriptHelper helper = createScriptHelper(scriptContext);
         if (helper != null) {
             context.put(SCRIPT_HELPER_KEY, helper);
         }
-        Bindings bindings = new ProtectedBindings(context, Collections.unmodifiableSet(protectedKeys));
-        scriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
         return scriptContext;
     }