Author: adrianc Date: Wed Jun 12 08:38:13 2013 New Revision: 1492117 URL: http://svn.apache.org/r1492117 Log: Merged revision(s) 1492112 from ofbiz/trunk: Fixed a bug introduced in revisions 1480407 and 1481287 - form widget fields were not translated.
https://issues.apache.org/jira/browse/OFBIZ-5219 Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1492112 Modified: ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=1492117&r1=1492116&r2=1492117&view=diff ============================================================================== --- ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original) +++ ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Wed Jun 12 08:38:13 2013 @@ -21,7 +21,6 @@ package org.ofbiz.widget.form; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -1523,7 +1522,8 @@ public class ModelForm extends ModelWidg if (itemMap instanceof GenericEntity) { // Rendering code might try to modify the GenericEntity instance, // so we make a copy of it. - localContext.push(new HashMap<String, Object>(itemMap)); + Map<String, Object> genericEntityClone = UtilGenerics.cast(((GenericEntity)itemMap).clone()); + localContext.push(genericEntityClone); } else { localContext.push(itemMap); } Modified: ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1492117&r1=1492116&r2=1492117&view=diff ============================================================================== --- ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original) +++ ofbiz/branches/release12.04/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Wed Jun 12 08:38:13 2013 @@ -1622,7 +1622,8 @@ public class ModelFormField { MapStack<String> localContext = MapStack.create(context); // Rendering code might try to modify the GenericEntity instance, // so we make a copy of it. - localContext.push(new HashMap<String, Object>(value)); + Map<String, Object> genericEntityClone = UtilGenerics.cast(value.clone()); + localContext.push(genericEntityClone); // expand with the new localContext, which is locale aware String optionDesc = this.description.expandString(localContext, locale); @@ -2181,7 +2182,8 @@ public class ModelFormField { MapStack<String> localContext = MapStack.create(context); // Rendering code might try to modify the GenericEntity instance, // so we make a copy of it. - localContext.push(new HashMap<String, Object>(value)); + Map<String, Object> genericEntityClone = UtilGenerics.cast(value.clone()); + localContext.push(genericEntityClone); // expand with the new localContext, which is locale aware retVal = this.description.expandString(localContext, locale);