[jira] [Commented] (OFBIZ-7264) Use ShoppingCartEvents.getCartObject() to get shopping cart

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-7264) Use ShoppingCartEvents.getCartObject() to get shopping cart

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-7264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15498618#comment-15498618 ]

Jacopo Cappellato commented on OFBIZ-7264:
------------------------------------------

I think there is an issue in this patch:

{code}
Index: applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
===================================================================
--- applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (revision 1748917)
+++ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (working copy)
@@ -949,7 +949,7 @@
     /** Gets or creates the shopping cart object */
     public static ShoppingCart getCartObject(HttpServletRequest request, Locale locale, String currencyUom) {
         LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
-        ShoppingCart cart = (ShoppingCart) request.getAttribute("shoppingCart");
+        ShoppingCart cart = getCartObject(request);
         HttpSession session = request.getSession(true);
         if (cart == null) {
             cart = (ShoppingCart) session.getAttribute("shoppingCart");
{code}

The above change would end up in a call loop of getCartObject calls.

> Use ShoppingCartEvents.getCartObject() to get shopping cart
> ------------------------------------------------------------
>
>                 Key: OFBIZ-7264
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-7264
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Deepak Dixit
>            Assignee: Jacopo Cappellato
>         Attachments: OFBIZ-7264.patch
>
>
> As per current code base in many places shoppingcart is get directly from session, we have method getCartObject() in ShoppingCartEvetns.java to get the shoppingcart.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)