Author: jleroux Date: Wed Jun 25 11:41:28 2014 New Revision: 1605356 URL: http://svn.apache.org/r1605356 Log: "Applied fix from trunk for revision: 1605354 " ------------------------------------------------------------------------ r1605354 | jleroux | 2014-06-25 13:39:53 +0200 (mer. 25 juin 2014) | 3 lignes
A patch from Sebastian Leitner for "Anonymous customer looses locale on order" https://issues.apache.org/jira/browse/OFBIZ-5666 If an anonymous customer changes his/her locale (/control/setSessionLocale) and then places an order in an ecommerce-application, the event ShoppingCartEvents.clearCart(HttpServletRequest, HttpServletResponse) invalidates the session and creates a new one. Due to that the previous locale-switch is lost and is set back to browser- or server-default. ------------------------------------------------------------------------ Modified: ofbiz/branches/release13.07/ (props changed) ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Propchange: ofbiz/branches/release13.07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1605354 Modified: ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1605356&r1=1605355&r2=1605356&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/branches/release13.07/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Wed Jun 25 11:41:28 2014 @@ -904,9 +904,14 @@ public class ShoppingCartEvents { HttpSession session = request.getSession(); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); if (userLogin != null && "anonymous".equals(userLogin.get("userLoginId"))) { + Locale locale = UtilHttp.getLocale(session); + // here we want to do a full logout, but not using the normal logout stuff because it saves things in the UserLogin record that we don't want changed for the anonymous user session.invalidate(); session = request.getSession(true); + if (null != locale) { + UtilHttp.setLocale(session, locale); + } // to allow the display of the order confirmation page put the userLogin in the request, but leave it out of the session request.setAttribute("temporaryAnonymousUserLogin", userLogin);

