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/12/27 17:08:22 UTC

svn commit: r1426238 - in /ofbiz/branches/release12.04: ./ framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java

Author: jleroux
Date: Thu Dec 27 16:08:22 2012
New Revision: 1426238

URL: http://svn.apache.org/viewvc?rev=1426238&view=rev
Log:
"Applied fix from trunk for revision: 1426231" 
------------------------------------------------------------------------
r1426231 | jleroux | 2012-12-27 16:51:10 +0100 (jeu., 27 déc. 2012) | 4 lines

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/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1426231

Modified: ofbiz/branches/release12.04/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=1426238&r1=1426237&r2=1426238&view=diff
==============================================================================
--- ofbiz/branches/release12.04/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java (original)
+++ ofbiz/branches/release12.04/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java Thu Dec 27 16:08:22 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);