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 2012/07/08 15:17:27 UTC

svn commit: r1358738 - in /ofbiz/branches/release10.04: ./ framework/widget/src/org/ofbiz/widget/form/ModelForm.java

Author: jleroux
Date: Sun Jul  8 13:17:26 2012
New Revision: 1358738

URL: http://svn.apache.org/viewvc?rev=1358738&view=rev
Log:
"Applied fix from trunk for revision: 1358735  " 
------------------------------------------------------------------------
r1358735 | jleroux | 2012-07-08 15:15:56 +0200 (dim., 08 juil. 2012) | 7 lines

A patch from Daniel Riquelme "Not getting right behavior of use-when when using in multi" https://issues.apache.org/jira/browse/OFBIZ-4932

The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

jleroux: since the BshInterpreter is reseted just after with localContext this should not have any bad side effects
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release10.04/   (props changed)
    ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java

Propchange: ofbiz/branches/release10.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1358735

Modified: ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=1358738&r1=1358737&r2=1358738&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/branches/release10.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Sun Jul  8 13:17:26 2012
@@ -1441,6 +1441,9 @@ public class ModelForm extends ModelWidg
                 if (itemIndex < lowIndex) {
                     continue;
                 }
+                
+                // reset/remove the BshInterpreter now as well as later because chances are there is an interpreter at this level of the stack too
+                this.resetBshInterpreter(context);
 
                 Map<String, Object> itemMap = UtilGenerics.checkMap(item);
                 MapStack<String> localContext = MapStack.create(context);