Author: jacopoc Date: Mon Sep 18 08:06:21 2006 New Revision: 447424 URL: http://svn.apache.org/viewvc?view=rev&rev=447424 Log: Fixed (bad) bug I've introduced during the drop shipment development effort: the OrderItemShipGroup.supplierPartyId was set to "" (not null) if the supplier for the ship group was not selected (as happens in most of the orders, i.e. the ones that are not drop shipped). This causes a fk violation error when the order is created. I've noticed this only now because I've started my tests in a newly created db (with all the fk correctly set).
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?view=diff&rev=447424&r1=447423&r2=447424 ============================================================================== --- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original) +++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Mon Sep 18 08:06:21 2006 @@ -1249,7 +1249,9 @@ //Verify the field is valid if (UtilValidate.isNotEmpty(shippingContactMechId)) { this.cart.setShippingContactMechId(shipGroupIndex, shippingContactMechId); - this.cart.setSupplierPartyId(shipGroupIndex, supplierPartyId); + if (UtilValidate.isNotEmpty(supplierPartyId)) { + this.cart.setSupplierPartyId(shipGroupIndex, supplierPartyId); + } result = ServiceUtil.returnSuccess(); } else { errMsg = UtilProperties.getMessage(resource,"checkhelper.enter_shipping_address", (cart != null ? cart.getLocale() : Locale.getDefault()));