Author: sichen
Date: Mon Sep 18 15:36:52 2006 New Revision: 447604 URL: http://svn.apache.org/viewvc?view=rev&rev=447604 Log: Fix annoying bug where bad orderId will crash instead of just return not found Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderviewwebsecure.bsh Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh?view=diff&rev=447604&r1=447603&r2=447604 ============================================================================== --- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh (original) +++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh Mon Sep 18 15:36:52 2006 @@ -381,14 +381,14 @@ } } -// list to find all the POSTAL_ADDRESS for the shipment party. -orderParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); -shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); -context.put("shippingContactMechList",shippingContactMechList); - -// list to find all the shipmentMethods from the view named "ProductStoreShipmentMethView". if (orderHeader != null) { -productStoreId = orderHeader.getRelatedOne("ProductStore").getString("productStoreId"); -productStoreShipmentMethList = delegator.findByAndCache("ProductStoreShipmentMethView", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNumber")); -context.put("productStoreShipmentMethList",productStoreShipmentMethList); + // list to find all the POSTAL_ADDRESS for the shipment party. + orderParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); + shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); + context.put("shippingContactMechList",shippingContactMechList); + + // list to find all the shipmentMethods from the view named "ProductStoreShipmentMethView". + productStoreId = orderHeader.getRelatedOne("ProductStore").getString("productStoreId"); + productStoreShipmentMethList = delegator.findByAndCache("ProductStoreShipmentMethView", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNumber")); + context.put("productStoreShipmentMethList",productStoreShipmentMethList); } Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderviewwebsecure.bsh URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderviewwebsecure.bsh?view=diff&rev=447604&r1=447603&r2=447604 ============================================================================== --- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderviewwebsecure.bsh (original) +++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderviewwebsecure.bsh Mon Sep 18 15:36:52 2006 @@ -22,7 +22,8 @@ orderHeader = context.get("orderHeader"); -if (orderHeader != null) { +// if orderHeader is null in orderview.bsh then it is not null but void here! +if ((orderHeader != null) && (orderHeader != void)) { // set hasPermission, must always exist if the orderHeader != null // hasPermission if: has ORDERMGR_VIEW, ORDERMGR_ROLE_VIEW & associated with order, or is associated in the SUPPLIER_AGENT role hasPermission = false; |
Free forum by Nabble | Edit this page |