Author: nmalin
Date: Tue Apr 16 19:29:30 2019
New Revision: 1857657
URL:
http://svn.apache.org/viewvc?rev=1857657&view=revLog:
Fixed: Duplicate a ShoppingCartItem didn't propage OrderItemAttributes
(OFBIZ-10929)
When you clone a ShoppingCartItem by constructor :
ShoppingCartItem sci = new ShoppingCartItem(ShoppingCartItem item)
The ShoppingCartItem.orderItemAttributes wasn't propage from origin.
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1857657&r1=1857656&r2=1857657&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java Tue Apr 16 19:29:30 2019
@@ -679,10 +679,7 @@ public class ShoppingCartItem implements
this.associatedOrderItemSeqId = item.getAssociatedOrderItemSeqId();
this.orderItemAssocTypeId = item.getOrderItemAssocTypeId();
this.setStatusId(item.getStatusId());
- if (UtilValidate.isEmpty(item.getOrderItemAttributes())) {
- this.orderItemAttributes = new HashMap<>();
- this.orderItemAttributes.putAll(item.getOrderItemAttributes());
- }
+ this.orderItemAttributes = item.getOrderItemAttributes() == null ? new HashMap<>() : new HashMap<>(item.getOrderItemAttributes());
this.attributes = item.getAttributes() == null ? new HashMap<>() : new HashMap<>(item.getAttributes());
this.setOrderItemSeqId(item.getOrderItemSeqId());
this.locale = item.locale;