Author: jonesde
Date: Fri Nov 3 23:57:52 2006 New Revision: 471137 URL: http://svn.apache.org/viewvc?view=rev&rev=471137 Log: Fixed bug where placingUserLogin isn't found for anonymous users, so the userLogin from anonymous request variable is now used; this is tested and fixes the confirmation email problem Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=471137&r1=471136&r2=471137 ============================================================================== --- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Fri Nov 3 23:57:52 2006 @@ -38,12 +38,12 @@ <attribute name="sendTo" type="String" mode="IN" optional="true"/> <attribute name="sendCc" type="String" mode="IN" optional="true"/> <attribute name="note" type="String" mode="IN" optional="true"/> + <attribute name="temporaryAnonymousUserLogin" type="GenericValue" mode="IN" optional="true"/> </service> <service name="sendOrderConfirmation" engine="java" require-new-transaction="true" max-retry="3" location="org.ofbiz.order.order.OrderServices" invoke="sendOrderConfirmNotification"> <description>Send a order confirmation</description> <implements service="orderNotificationInterface"/> - <attribute name="temporaryAnonymousUserLogin" type="GenericValue" mode="IN" optional="true"/> </service> <service name="sendOrderChangeNotification" engine="java" require-new-transaction="true" max-retry="3" location="org.ofbiz.order.order.OrderServices" invoke="sendOrderChangeNotification"> Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=471137&r1=471136&r2=471137 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Nov 3 23:57:52 2006 @@ -2015,13 +2015,12 @@ String note = (String) context.get("note"); String screenUri = (String) context.get("screenUri"); + GenericValue temporaryAnonymousUserLogin = (GenericValue) context.get("temporaryAnonymousUserLogin"); if (userLogin == null) { // this may happen during anonymous checkout, try to the special case user - GenericValue temporaryAnonymousUserLogin = (GenericValue) context.get("temporaryAnonymousUserLogin"); userLogin = temporaryAnonymousUserLogin; } - // prepare the order information Map sendMap = FastMap.newInstance(); @@ -2079,6 +2078,12 @@ if (locale == null && placingParty != null) { locale = PartyWorker.findPartyLastLocale(placingParty.getString("partyId"), delegator); } + + // for anonymous orders, use the temporaryAnonymousUserLogin as the placingUserLogin will be null + if (placingUserLogin == null) { + placingUserLogin = temporaryAnonymousUserLogin; + } + GenericValue productStore = OrderReadHelper.getProductStoreFromOrder(orderHeader); if (locale == null && productStore != null) { String localeString = productStore.getString("defaultLocaleString"); Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?view=diff&rev=471137&r1=471136&r2=471137 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Fri Nov 3 23:57:52 2006 @@ -617,7 +617,7 @@ // 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); - Debug.logInfo("Doing clearCart for anonymous user, so logging out but put anonymous userLogin in userLogin request attribute", module); + Debug.logInfo("Doing clearCart for anonymous user, so logging out but put anonymous userLogin in temporaryAnonymousUserLogin request attribute", module); } return "success"; |
Free forum by Nabble | Edit this page |