Author: jleroux
Date: Wed May 22 21:33:35 2013
New Revision: 1485438
URL:
http://svn.apache.org/r1485438Log:
"Applied fix from trunk for revision: 1485432 " (conflict resolved by hand)
------------------------------------------------------------------------
r1485432 | jleroux | 2013-05-22 23:29:02 +0200 (mer., 22 mai 2013) | 7 lines
A sligthly modified patch from Jonatan Soto for "ConcurrentModificationException when cancelling an order"
https://issues.apache.org/jira/browse/OFBIZ-5194After the order gets cancelled, there is a loop in OrderView.groovy@122 that removes promotional order line items retrieved from the OrderReadHelper class when cancelled. This is what makes the ConcurrentModificationException to be thrown.
For further details, check out the following thread at the dev mailing list:
http://ofbiz.markmail.org/message/vmm65cmbf5hkmqm6?page=2jleroux: I simply put a comment and removed the useless temporary orderItemListFiltered variable
------------------------------------------------------------------------
Modified:
ofbiz/branches/release10.04/ (props changed)
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
Propchange: ofbiz/branches/release10.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1485432
Modified: ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1485438&r1=1485437&r2=1485438&view=diff==============================================================================
--- ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (original)
+++ ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy Wed May 22 21:33:35 2013
@@ -114,15 +114,11 @@ if (orderHeader) {
grandTotal = OrderReadHelper.getOrderGrandTotal(orderItems, orderAdjustments);
context.grandTotal = grandTotal;
- canceledPromoOrderItem = [:];
orderItemList = orderReadHelper.getOrderItems();
- orderItemList.each { orderItem ->
- if("Y".equals(orderItem.get("isPromo")) && "ITEM_CANCELLED".equals(orderItem.get("statusId"))) {
- canceledPromoOrderItem = orderItem;
- }
- orderItemList.remove(canceledPromoOrderItem);
+ // Retrieve all non-promo items that aren't cancelled
+ context.orderItemList = orderReadHelper.getOrderItems().findAll { item ->
+ (item.isPromo == null || item.isPromo == 'N') && !(item.statusId.equals('ITEM_CANCELLED'))
}
- context.orderItemList = orderItemList;
shippingAddress = orderReadHelper.getShippingAddress();
context.shippingAddress = shippingAddress;