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 2014/06/25 13:41:33 UTC

svn commit: r1605358 - in /ofbiz/branches/release11.04: ./ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Author: jleroux
Date: Wed Jun 25 11:41:33 2014
New Revision: 1605358

URL: http://svn.apache.org/r1605358
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/release11.04/   (props changed)
    ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1605354

Modified: ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1605358&r1=1605357&r2=1605358&view=diff
==============================================================================
--- ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Wed Jun 25 11:41:33 2014
@@ -842,9 +842,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);