diff options
author | mattab <matthieu.aubry@gmail.com> | 2016-03-03 18:32:12 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2016-03-03 18:32:12 +0300 |
commit | 94f3a97f5688054f2e305d44ad51681152aeee7d (patch) | |
tree | 14f3080f04538e6ca4abd49e824c7eabed6121d7 /plugins/Transitions | |
parent | 6f3faf8c9dea2772ab74891a4c3c7216e231b84c (diff) |
Prefix DB field by the table alias, to prevent error when a segment joins another table that has some field names in common #9822
Diffstat (limited to 'plugins/Transitions')
-rw-r--r-- | plugins/Transitions/API.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php index 1ab38f89ae..89823d89c9 100644 --- a/plugins/Transitions/API.php +++ b/plugins/Transitions/API.php @@ -222,7 +222,8 @@ class API extends \Piwik\Plugin\API if ($actionType != 'title') { // specific setup for page urls $types[Action::TYPE_PAGE_URL] = 'followingPages'; - $dimension = 'if ( idaction_url IS NULL, idaction_name, idaction_url )'; + $dimension = 'if ( %s.idaction_url IS NULL, %s.idaction_name, %s.idaction_url )'; + $dimension = str_replace('%s', 'log_link_visit_action', $dimension ); // site search referrers are logged with url=NULL // when we find one, we have to join on name $joinLogActionColumn = $dimension; @@ -405,7 +406,8 @@ class API extends \Piwik\Plugin\API if ($dimension == 'idaction_url_ref') { // site search referrers are logged with url_ref=NULL // when we find one, we have to join on name_ref - $dimension = 'if ( idaction_url_ref IS NULL, idaction_name_ref, idaction_url_ref )'; + $dimension = 'if ( %s.idaction_url_ref IS NULL, %s.idaction_name_ref, %s.idaction_url_ref )'; + $dimension = str_replace('%s', 'log_link_visit_action', $dimension ); $joinLogActionOn = $dimension; } else { $joinLogActionOn = $dimension; |