You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/01/03 17:41:49 UTC

svn commit: r1555142 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy

Author: jleroux
Date: Fri Jan  3 16:41:49 2014
New Revision: 1555142

URL: http://svn.apache.org/r1555142
Log:
Fixes a bug reported by Christian Carlow at 
https://issues.apache.org/jira/browse/OFBIZ-5457 for "Groovy error when initiating sales order creation for unkown partyId" 

This error is generated when an unknown partyId is entered in the Customer field of the sales order entry form:

To resolve the issue, lines 60-63 of CheckInits.groovy should be wrapped in an IF block checking for the existence of the product variable previously assigned.

jleroux: Christian's patch did not apply but it was easy to do it by hand.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy?rev=1555142&r1=1555141&r2=1555142&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy Fri Jan  3 16:41:49 2014
@@ -57,9 +57,11 @@ partyId = null;
 partyId = parameters.partyId;
 if (partyId) {
     party = delegator.findOne("Person", [partyId : partyId], false);
-    contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false));
-    if (contactMech) {
-        ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request);
-        shoppingCart.setAllShippingContactMechId(contactMech.contactMechId);
+    if (party) {
+        contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false));
+        if (contactMech) {
+            ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request);
+            shoppingCart.setAllShippingContactMechId(contactMech.contactMechId);
+        }
     }
 }