diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index bcd540bca0a..d875ced45f3 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -307,7 +307,7 @@ protected function getNameAndType() protected function getUrlAndType() { $url = $this->getActionUrl(); - if (!is_null($url)) { + if (!empty($url)) { // normalize urls by stripping protocol and www $url = PageUrl::normalizeUrl($url); return array($url['url'], Tracker\Action::TYPE_PAGE_URL, $url['prefixId']); diff --git a/core/Tracker/ActionSiteSearch.php b/core/Tracker/ActionSiteSearch.php index 210d848386f..ee380be9791 100644 --- a/core/Tracker/ActionSiteSearch.php +++ b/core/Tracker/ActionSiteSearch.php @@ -54,6 +54,8 @@ function isSearchDetected() } $this->setActionName($actionName); $this->setActionUrl($url); + + return true; } // FIXMEA replace by getNameAndType diff --git a/core/Tracker/PageUrl.php b/core/Tracker/PageUrl.php index 46fc0685de2..dc3073b3af5 100644 --- a/core/Tracker/PageUrl.php +++ b/core/Tracker/PageUrl.php @@ -321,7 +321,7 @@ public static function getUrlIfLookValid($url) if (!UrlHelper::isLookLikeUrl($url)) { Common::printDebug("WARNING: URL looks invalid and is discarded"); - $url = ''; + $url = false; return $url; } return $url; diff --git a/core/Tracker/TableActionIds.php b/core/Tracker/TableActionIds.php index 6fd46343fe5..ab64fa34fd9 100644 --- a/core/Tracker/TableActionIds.php +++ b/core/Tracker/TableActionIds.php @@ -95,7 +95,8 @@ public static function loadActionId($actionNamesAndTypes) $actionId = Tracker::getDatabase()->lastInsertId(); Common::printDebug("Recorded a new action (" . Action::getTypeAsString($type) . ") in the lookup table: " . $name . " (idaction = " . $actionId . ")"); - $actionNamesAndTypes[$actionToInsert][] = $actionId; + $keyIdAction = 3; + $actionNamesAndTypes[$actionToInsert][$keyIdAction] = $actionId; } return $actionNamesAndTypes; } diff --git a/piwik.php b/piwik.php index fa98df9076f..36201b00616 100644 --- a/piwik.php +++ b/piwik.php @@ -55,7 +55,12 @@ require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitInterface.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Visit.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/GoalManager.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Tracker/PageUrl.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Tracker/TableActionIds.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Action.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionClickUrl.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionPageview.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Tracker/ActionSiteSearch.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Request.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Referrer.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitExcluded.php';