You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/05/11 12:34:57 UTC

svn commit: r1481287 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Author: adrianc
Date: Sat May 11 10:34:57 2013
New Revision: 1481287

URL: http://svn.apache.org/r1481287
Log:
Copied the fix from revision 1480407 to the rest of the screen widgets.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1481287&r1=1481286&r2=1481287&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Sat May 11 10:34:57 2013
@@ -1622,7 +1622,9 @@ public class ModelFormField {
                 for (GenericValue value: values) {
                     // add key and description with string expansion, ie expanding ${} stuff, passing locale explicitly to expand value string because it won't be found in the Entity
                     MapStack<String> localContext = MapStack.create(context);
-                    localContext.push(value);
+                    // Rendering code might try to modify the GenericEntity instance,
+                    // so we make a copy of it.
+                    localContext.push(new HashMap<String, Object>(value));
 
                     // expand with the new localContext, which is locale aware
                     String optionDesc = this.description.expandString(localContext, locale);
@@ -2179,7 +2181,9 @@ public class ModelFormField {
             if (value != null) {
                 // expanding ${} stuff, passing locale explicitly to expand value string because it won't be found in the Entity
                 MapStack<String> localContext = MapStack.create(context);
-                localContext.push(value);
+                // Rendering code might try to modify the GenericEntity instance,
+                // so we make a copy of it.
+                localContext.push(new HashMap<String, Object>(value));
 
                 // expand with the new localContext, which is locale aware
                 retVal = this.description.expandString(localContext, locale);