Skip to content

Commit

Permalink
Removing broken config setting for Transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 22, 2013
1 parent 1ec4a73 commit 3d729ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
5 changes: 0 additions & 5 deletions config/global.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,6 @@
; maximum length of a Page Title or a Page URL recorded in the log_action.name table
page_maximum_length = 1024;

; By default, when a request is identified as a "Internal Site Search", the URL will not be recorded. This is for performance reasons
; (the less unique URLs in Piwik the better). Piwik will track, for each Site Search: "Search Keyword",
; and optionally the "Search Category" and "Search result count". You can set this to 1 to enable tracking Site Search URLs.
action_sitesearch_record_url = 0

; Anonymize a visitor's IP address after testing for "Ip exclude"
; This value is the level of anonymization Piwik will use; if the AnonymizeIP plugin is deactivated, this value is ignored.
; For IPv4/IPv6 addresses, valid values are the number of octets in IP address to mask (from 0 to 4).
Expand Down
19 changes: 15 additions & 4 deletions core/Tracker/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ public function getIdActionUrl()
return (int)$idUrl;
}


public function getIdActionUrlForEntryAndExitIds()
{
return $this->getIdActionUrl();
}

public function getIdActionNameForEntryAndExitIds()
{
return $this->getIdActionName();
}

public function getIdActionName()
{
if(!isset($this->actionIdsCached['idaction_name'])) {
Expand Down Expand Up @@ -294,9 +305,9 @@ public function record($idVisit, $visitorIdCookie, $idReferrerActionUrl, $idRefe

$insert = array_merge($insert, $customVariables);

$fields = implode(", ", array_keys($insertWithoutNulls));
$bind = array_values($insertWithoutNulls);
$values = Common::getSqlStringFieldsArray($insertWithoutNulls);
$fields = implode(", ", array_keys($insert));
$bind = array_values($insert);
$values = Common::getSqlStringFieldsArray($insert);

$sql = "INSERT INTO " . Common::prefixTable('log_link_visit_action') . " ($fields) VALUES ($values)";
Tracker::getDatabase()->query($sql, $bind);
Expand All @@ -312,7 +323,7 @@ public function record($idVisit, $visitorIdCookie, $idReferrerActionUrl, $idRefe
'timeSpentReferrerAction' => $timeSpentReferrerAction,
);
Common::printDebug("Inserted new action:");
Common::printDebug($insertWithoutNulls);
Common::printDebug($insert);

/**
* This hook is called after saving (and updating) visitor information. You can use it for instance to sync the
Expand Down
10 changes: 1 addition & 9 deletions core/Tracker/ActionSiteSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,14 @@ protected function getActionsToLookup()
{
return array(
'idaction_name' => array($this->getActionName(), Action::TYPE_SITE_SEARCH),
'idaction_url' => $this->getUrlAndType(),
);
}

public function getIdActionUrl()
{
// Site Search, by default, will not track URL. We do not want URL to appear as "Page URL not defined"
// so we specifically set it to NULL in the table (the archiving query does IS NOT NULL)
if (empty(Config::getInstance()->Tracker['action_sitesearch_record_url'])) {
return null;
}
return parent::getIdActionUrl();
return null;
}

public function getCustomFloatValue()
Expand Down Expand Up @@ -197,17 +193,13 @@ protected function detectSiteSearch($originalUrl)
}

$actionName = $url = $categoryName = $count = false;
$doTrackUrlForSiteSearch = !empty(Config::getInstance()->Tracker['action_sitesearch_record_url']);

$originalUrl = PageUrl::cleanupUrl($originalUrl);

// Detect Site search from Tracking API parameters rather than URL
$searchKwd = $this->request->getParam('search');
if (!empty($searchKwd)) {
$actionName = $searchKwd;
if ($doTrackUrlForSiteSearch) {
$url = $originalUrl;
}
$isCategoryName = $this->request->getParam('search_cat');
if (!empty($isCategoryName)) {
$categoryName = $isCategoryName;
Expand Down

0 comments on commit 3d729ef

Please sign in to comment.