svn commit: r980764 - /ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

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

svn commit: r980764 - /ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

lektran
Author: lektran
Date: Fri Jul 30 12:40:41 2010
New Revision: 980764

URL: http://svn.apache.org/viewvc?rev=980764&view=rev
Log:
Merged from trunk r980747:
Fix for OFBIZ-3786 reported by Sascha Rodekamp, first-visit controller events were not being executed.  Fix based on a simplified version of the patch provided by Sascha.

Modified:
    ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=980764&r1=980763&r2=980764&view=diff
==============================================================================
--- ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/release10.04/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Fri Jul 30 12:40:41 2010
@@ -274,23 +274,20 @@ public class RequestHandler {
             }
 
             // If its the first visit run the first visit events.
-            if (this.trackVisit(request) && session.getAttribute("visit") == null) {
+            if (this.trackVisit(request) && session.getAttribute("_FIRST_VISIT_EVENTS_") == null) {
                 if (Debug.infoOn())
                     Debug.logInfo("This is the first request in this visit." + " sessionId=" + UtilHttp.getSessionId(request), module);
-                // This isn't an event because it is required to run. We do not want to make it optional.
-                GenericValue visit = VisitHandler.getVisit(session);
-                if (visit != null) {
-                    for (ConfigXMLReader.Event event: controllerConfig.getFirstVisitEventList().values()) {
-                        try {
-                            String returnString = this.runEvent(request, response, event, null, "firstvisit");
-                            if (returnString != null && !returnString.equalsIgnoreCase("success")) {
-                                throw new EventHandlerException("First-Visit event did not return 'success'.");
-                            } else if (returnString == null) {
-                                interruptRequest = true;
-                            }
-                        } catch (EventHandlerException e) {
-                            Debug.logError(e, module);
+                session.setAttribute("_FIRST_VISIT_EVENTS_", "complete");
+                for (ConfigXMLReader.Event event: controllerConfig.getFirstVisitEventList().values()) {
+                    try {
+                        String returnString = this.runEvent(request, response, event, null, "firstvisit");
+                        if (returnString != null && !returnString.equalsIgnoreCase("success")) {
+                            throw new EventHandlerException("First-Visit event did not return 'success'.");
+                        } else if (returnString == null) {
+                            interruptRequest = true;
                         }
+                    } catch (EventHandlerException e) {
+                        Debug.logError(e, module);
                     }
                 }
             }