Author: jonesde
Date: Mon Jan 11 09:39:59 2010
New Revision: 897817
URL:
http://svn.apache.org/viewvc?rev=897817&view=revLog:
Improved an error message, and changed some funny code that messes things up if there is no productTypeId on a Product
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=897817&r1=897816&r2=897817&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Mon Jan 11 09:39:59 2010
@@ -723,9 +723,8 @@
this.itemType = "PRODUCT_ORDER_ITEM";
}
} else {
- Debug.logError("Error calling ShoppingCartItem (trying to creates new ShoppingCartItem object)." +
- " Check that there is a type for this product ", module);
- return;
+ // NOTE DEJ20100111: it seems safe to assume here that because a product is passed in that even if the product has no type this type of item still applies; thanks to whoever wrote the previous code, that's a couple of hours tracking this down that I wouldn't have minded doing something else with... :)
+ this.itemType = "PRODUCT_ORDER_ITEM";
}
} else {
this.itemType = itemType;
@@ -2411,7 +2410,7 @@
public Delegator getDelegator() {
if (delegator == null) {
if (UtilValidate.isEmpty(delegatorName)) {
- throw new IllegalStateException("Bad delegator name");
+ throw new IllegalStateException("No delegator or delegatorName on ShoppingCartItem, somehow was not setup right.");
}
delegator = DelegatorFactory.getDelegator(delegatorName);
}