From 7c2fba6d5a91475ac06e70062d8ef3df57d47dcd Mon Sep 17 00:00:00 2001
From: Thomas Steur <thomas.steur@gmail.com>
Date: Mon, 7 Dec 2015 11:47:20 +1300
Subject: [PATCH] fix exit page was not correct when last action was download
 or outlink (cherry picked from commit 092ccb6)

---
 core/Tracker/Action.php                       |  4 ++--
 core/Tracker/ActionPageview.php               | 10 ++++++++++
 plugins/Actions/Columns/VisitTotalActions.php |  3 ++-
 plugins/Contents/Actions/ActionContent.php    | 11 -----------
 plugins/Events/Actions/ActionEvent.php        | 12 ------------
 5 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php
index 8326df8deb..bdb4efc7ad 100644
--- a/core/Tracker/Action.php
+++ b/core/Tracker/Action.php
@@ -248,12 +248,12 @@ abstract class Action
 
     public function getIdActionUrlForEntryAndExitIds()
     {
-        return $this->getIdActionUrl();
+        return false;
     }
 
     public function getIdActionNameForEntryAndExitIds()
     {
-        return $this->getIdActionName();
+        return false;
     }
 
     public function getIdActionName()
diff --git a/core/Tracker/ActionPageview.php b/core/Tracker/ActionPageview.php
index eb98dd4b23..79f8f46724 100644
--- a/core/Tracker/ActionPageview.php
+++ b/core/Tracker/ActionPageview.php
@@ -51,6 +51,16 @@ class ActionPageview extends Action
         return true;
     }
 
+    public function getIdActionUrlForEntryAndExitIds()
+    {
+        return $this->getIdActionUrl();
+    }
+
+    public function getIdActionNameForEntryAndExitIds()
+    {
+        return $this->getIdActionName();
+    }
+
     private function cleanupActionName($actionName)
     {
         // get the delimiter, by default '/'; BC, we read the old action_category_delimiter first (see #1067)
diff --git a/plugins/Actions/Columns/VisitTotalActions.php b/plugins/Actions/Columns/VisitTotalActions.php
index 914f18ba8e..750cfc8667 100644
--- a/plugins/Actions/Columns/VisitTotalActions.php
+++ b/plugins/Actions/Columns/VisitTotalActions.php
@@ -79,8 +79,9 @@ class VisitTotalActions extends VisitDimension
         }
 
         $actionType = $action->getActionType();
+        $types = array(Action::TYPE_SITE_SEARCH, Action::TYPE_EVENT, Action::TYPE_OUTLINK, Action::TYPE_DOWNLOAD);
 
-        if (in_array($actionType, array(Action::TYPE_SITE_SEARCH, Action::TYPE_EVENT))) {
+        if (in_array($actionType, $types)) {
             return $increment;
         }
 
diff --git a/plugins/Contents/Actions/ActionContent.php b/plugins/Contents/Actions/ActionContent.php
index 024c403d81..b328ebcc6c 100644
--- a/plugins/Contents/Actions/ActionContent.php
+++ b/plugins/Contents/Actions/ActionContent.php
@@ -40,15 +40,4 @@ class ActionContent extends Action
         );
     }
 
-    // Do not track this Event URL as Entry/Exit Page URL (leave the existing entry/exit)
-    public function getIdActionUrlForEntryAndExitIds()
-    {
-        return false;
-    }
-
-    // Do not track this Event Name as Entry/Exit Page Title (leave the existing entry/exit)
-    public function getIdActionNameForEntryAndExitIds()
-    {
-        return false;
-    }
 }
diff --git a/plugins/Events/Actions/ActionEvent.php b/plugins/Events/Actions/ActionEvent.php
index 5106ec6092..83af0d7ad1 100644
--- a/plugins/Events/Actions/ActionEvent.php
+++ b/plugins/Events/Actions/ActionEvent.php
@@ -73,18 +73,6 @@ class ActionEvent extends Action
         return array('idaction_url' => $actionUrl);
     }
 
-    // Do not track this Event URL as Entry/Exit Page URL (leave the existing entry/exit)
-    public function getIdActionUrlForEntryAndExitIds()
-    {
-        return false;
-    }
-
-    // Do not track this Event Name as Entry/Exit Page Title (leave the existing entry/exit)
-    public function getIdActionNameForEntryAndExitIds()
-    {
-        return false;
-    }
-
     public function writeDebugInfo()
     {
         $write = parent::writeDebugInfo();
-- 
GitLab