Author: jleroux
Date: Thu Aug  1 10:47:02 2013
New Revision: 1509164

URL: http://svn.apache.org/r1509164
Log:
A patch from János Zsolt for "Load cart from order loses OrderItemAttributes" 
https://issues.apache.org/jira/browse/OFBIZ-5286

When an order is created from a cart, OrderItemAttribute entities are created 
as expected. But when this same order is used to load back to the cart, the 
OrderItemAttributes are not reset. I found the cause of this issue in the 
org.ofbiz.order.shoppingcart.ShoppingCartServices.loadCartFromOrder(DispatchContext,
 Map<String, Object>) method.

Modified:
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Modified: 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1509164&r1=1509163&r2=1509164&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
 Thu Aug  1 10:47:02 2013
@@ -510,7 +510,7 @@ public class ShoppingCartServices {
                 List<GenericValue> orderItemAttributesList = null;
                 try {
                     orderItemAttributesList = 
delegator.findByAnd("OrderItemAttribute", UtilMisc.toMap("orderId", orderId, 
"orderItemSeqId", orderItemSeqId), null, false);
-                    if (UtilValidate.isNotEmpty(orderAttributesList)) {
+                    if (UtilValidate.isNotEmpty(orderItemAttributesList)) {
                         for (GenericValue orderItemAttr : 
orderItemAttributesList) {
                             String name = orderItemAttr.getString("attrName");
                             String value = 
orderItemAttr.getString("attrValue");


Reply via email to