Author: jleroux
Date: Thu Dec 27 15:51:10 2012
New Revision: 1426231
URL: http://svn.apache.org/viewvc?rev=1426231&view=rev
Log:
A patch from Deepak Dixit "Editing of product suppliers is not working for the
Germany locale" https://issues.apache.org/jira/browse/OFBIZ-4769
Thanks to Christian, Paul, Deepak, Adrian and I :)
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=1426231&r1=1426230&r2=1426231&view=diff
==============================================================================
---
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
(original)
+++
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Thu Dec 27 15:51:10 2012
@@ -27,6 +27,7 @@ import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.collections.FlexibleMapAccessor;
import org.ofbiz.base.util.string.FlexibleStringExpander;
@@ -107,24 +108,23 @@ public class PrimaryKeyFinder extends Fi
// try a map called "parameters", try it first so values from here
are overridden by values in the main context
Object parametersObj = context.get("parameters");
if (parametersObj != null && parametersObj instanceof Map<?, ?>) {
- tempVal.setAllFields(UtilGenerics.checkMap(parametersObj),
true, null, Boolean.TRUE);
+ Map<String, Object> parameters = UtilMisc.<String,
Object>toMap(UtilGenerics.checkMap(parametersObj));
+ // need the timeZone and locale for conversion, so add here
and remove after
+ parameters.put("locale", context.get("locale"));
+ parameters.put("timeZone", context.get("timeZone"));
+ modelEntity.convertFieldMapInPlace(parameters, delegator);
+ parameters.remove("timeZone");
+ parameters.remove("locale");
+ tempVal.setAllFields(parameters, true, null, Boolean.TRUE);
}
// just get the primary keys, and hopefully will get all of them,
if not they must be manually filled in below in the field-maps
+ modelEntity.convertFieldMapInPlace(context, delegator);
tempVal.setAllFields(context, true, null, Boolean.TRUE);
entityContext.putAll(tempVal);
}
EntityFinderUtil.expandFieldMapToContext(fieldMap, context,
entityContext);
- //Debug.logInfo("PrimaryKeyFinder: entityContext=" + entityContext,
module);
- // then convert the types...
-
- // need the timeZone and locale for conversion, so add here and remove
after
- entityContext.put("locale", context.get("locale"));
- entityContext.put("timeZone", context.get("timeZone"));
- modelEntity.convertFieldMapInPlace(entityContext, delegator);
- entityContext.remove("locale");
- entityContext.remove("timeZone");
// get the list of fieldsToSelect from selectFieldExpanderList
Set<String> fieldsToSelect =
EntityFinderUtil.makeFieldsToSelect(selectFieldExpanderList, context);