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:42:19 UTC

svn commit: r1555144 - in /ofbiz/branches/release12.04: ./ applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy

Author: jleroux
Date: Fri Jan  3 16:42:18 2014
New Revision: 1555144

URL: http://svn.apache.org/r1555144
Log:
"Applied fix from trunk for revision: 1555142" 
------------------------------------------------------------------------
r1555142 | jleroux | 2014-01-03 17:41:49 +0100 (ven. 03 janv. 2014) | 8 lignes

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/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1555142

Modified: ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy?rev=1555144&r1=1555143&r2=1555144&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy (original)
+++ ofbiz/branches/release12.04/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy Fri Jan  3 16:42:18 2014
@@ -57,9 +57,11 @@ partyId = null;
 partyId = parameters.partyId;
 if (partyId) {
     party = delegator.findByPrimaryKey("Person", [partyId : partyId]);
-    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);
+        }
     }
 }
\ No newline at end of file