svn commit: r562290 - /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r562290 - /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

jonesde
Author: jonesde
Date: Thu Aug  2 16:37:27 2007
New Revision: 562290

URL: http://svn.apache.org/viewvc?view=rev&rev=562290
Log:
Changed to always use the system user, bad if it tries to use the customer which is what would happen on an eca trigger

Modified:
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=562290&r1=562289&r2=562290
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Thu Aug  2 16:37:27 2007
@@ -299,7 +299,6 @@
         GenericDelegator delegator = ctx.getDelegator();
         String orderId = (String) context.get("orderId");
         String shipmentId = (String) context.get("shipmentId");
-        GenericValue userLogin = (GenericValue) context.get("userLogin");
         
         String sendToUrl = (String) context.get("sendToUrl");
         String saveToFilename = (String) context.get("saveToFilename");
@@ -308,12 +307,13 @@
         
         Map result = ServiceUtil.returnSuccess();
         MapStack bodyParameters =  MapStack.create();
-        if (userLogin == null) {
-            try {
-                userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
-            } catch (GenericEntityException e) {
-                Debug.logError(e, "Error getting userLogin", module);
-            }
+
+        // the userLogin passed in will usually be the customer, so don't use it; use the system user instead
+        GenericValue userLogin = null;
+        try {
+            userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+        } catch (GenericEntityException e) {
+            Debug.logError(e, "Error getting userLogin", module);
         }
         
         // check payment authorization