Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
"Applied fix from trunk for revision: 1426231"
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
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 :)

------------------------------------------------------------------------
?\026

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release10.04@1426252 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
JacquesLeRoux committed Dec 27, 2012
1 parent 8d0ab1e commit 07ea60f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Expand Up @@ -27,6 +27,7 @@
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;
Expand Down Expand Up @@ -103,24 +104,23 @@ public static GenericValue runFind(ModelEntity modelEntity, Map<String, Object>
// 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);
Expand Down

0 comments on commit 07ea60f

Please sign in to comment.