Author: jleroux
Date: Tue Jun  5 13:56:29 2018
New Revision: 1832944

URL: http://svn.apache.org/viewvc?rev=1832944&view=rev
Log:
Fixed: The first visit event are not executed in case of CMS
(OFBIZ-10389)

Execution of the first visit events depends on the trackVisit function

In RequestHandler.java file

if (this.trackVisit(request) && session.getAttribute("_FIRST_VISIT_EVENTS_") == 
null) {
    // execute first visit event
}

trackVisit function does not honor the default controller request 
(in this case, cms) So, we should improve the code of trackVisit to honor 
default controller request.


Thanks: Swapnil M Mane

Modified:
    
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java

Modified: 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java?rev=1832944&r1=1832943&r2=1832944&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
 Tue Jun  5 13:56:29 2018
@@ -1241,10 +1241,15 @@ public class RequestHandler {
             ConfigXMLReader.RequestMap requestMap = null;
             try {
                 requestMap = 
getControllerConfig().getRequestMapMap().get(uriString);
+                if (requestMap == null) {
+                    requestMap = 
getControllerConfig().getRequestMapMap().get(getControllerConfig().getDefaultRequest());
+                    if (requestMap == null) {
+                        return false;
+                    }
+                }
             } catch (WebAppConfigurationException e) {
                 Debug.logError(e, "Exception thrown while parsing 
controller.xml file: ", module);
             }
-            if (requestMap == null) return false;
             return requestMap.trackServerHit;
         } else {
             return false;
@@ -1260,10 +1265,15 @@ public class RequestHandler {
             ConfigXMLReader.RequestMap requestMap = null;
             try {
                 requestMap = 
getControllerConfig().getRequestMapMap().get(uriString);
+                if (requestMap == null) {
+                    requestMap = 
getControllerConfig().getRequestMapMap().get(getControllerConfig().getDefaultRequest());
+                    if (requestMap == null) {
+                        return false;
+                    }
+                }
             } catch (WebAppConfigurationException e) {
                 Debug.logError(e, "Exception thrown while parsing 
controller.xml file: ", module);
             }
-            if (requestMap == null) return false;
             return requestMap.trackVisit;
         } else {
             return false;


Reply via email to