Skip to content
Extraits de code Groupes Projets
Valider 94f3a97f rédigé par mattab's avatar mattab
Parcourir les fichiers

Prefix DB field by the table alias, to prevent error when a segment joins...

Prefix DB field by the table alias, to prevent error when a segment joins another table that has some field names in common #9822
parent 6f3faf8c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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;
......
......@@ -91,6 +91,15 @@ class TransitionsTest extends SystemTestCase
'limitBeforeGrouping' => 2
)
));
$return[] = array('Transitions.getTransitionsForPageTitle', array(
'idSite' => self::$fixture->idSite,
'date' => self::$fixture->dateTime,
'periods' => array('day'),
'testSuffix' => '_withSegment',
'otherRequestParameters' => array(
'pageTitle' => 'page title - page/one.html',
)
));
return $return;
}
......
<?xml version="1.0" encoding="utf-8" ?>
<result>
<date>Sat, Mar 6</date>
<previousPages>
<row>
<label>page title - the/third_page.html?foo=bar</label>
<referrals>3</referrals>
</row>
<row>
<label>page title - sub/dir/page2.html</label>
<referrals>2</referrals>
</row>
<row>
<label>page title - the/third_page.html?foo=baz#anchor1</label>
<referrals>1</referrals>
</row>
<row>
<label>page title - the/third_page.html?foo=baz#anchor2</label>
<referrals>1</referrals>
</row>
</previousPages>
<previousSiteSearches>
<row>
<label>mykwd</label>
<referrals>1</referrals>
</row>
<row>
<label>anotherkwd</label>
<referrals>1</referrals>
</row>
</previousSiteSearches>
<pageMetrics>
<loops>5</loops>
<pageviews>17</pageviews>
<entries>3</entries>
<exits>3</exits>
</pageMetrics>
<followingPages>
<row>
<label>page title - sub/dir/page2.html</label>
<referrals>2</referrals>
</row>
<row>
<label>page title - the/third_page.html?foo=bar</label>
<referrals>2</referrals>
</row>
<row>
<label>page title - the/third_page.html?foo=baz#anchor1</label>
<referrals>2</referrals>
</row>
<row>
<label>page title - the/third_page.html?foo=baz#anchor2</label>
<referrals>1</referrals>
</row>
<row>
<label>page title - page3.html</label>
<referrals>1</referrals>
</row>
</followingPages>
<followingSiteSearches>
<row>
<label>anotherkwd</label>
<referrals>1</referrals>
</row>
</followingSiteSearches>
<outlinks>
<row>
<label>http://www.anothersite.com/to/outlink/page.html</label>
<referrals>1</referrals>
</row>
<row>
<label>http://anothersite.com/to/outlink/page2.html</label>
<referrals>1</referrals>
</row>
</outlinks>
<downloads>
<row>
<label>http://example.org/downloads/33.tar.gz</label>
<referrals>1</referrals>
</row>
<row>
<label>https://example.org/downloads/35.tar.gz</label>
<referrals>1</referrals>
</row>
</downloads>
<referrers>
<row>
<label>Direct Entries</label>
<shortName>direct</shortName>
<visits>1</visits>
<details>
</details>
</row>
<row>
<label>From Search Engines</label>
<shortName>search</shortName>
<visits>1</visits>
<details>
<row>
<label>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</label>
<referrals>1</referrals>
</row>
</details>
</row>
<row>
<label>From Websites</label>
<shortName>website</shortName>
<visits>1</visits>
<details>
<row>
<label>http://www.external.com.vn/referrerPage-counted.html</label>
<referrals>1</referrals>
</row>
</details>
</row>
</referrers>
</result>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<result>
<error message="SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'idaction_url' in field list is ambiguous
--&gt; To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php" />
<date>Sat, Mar 6</date>
<previousPages>
<row>
<label>example.org/the/third_page.html?foo=bar</label>
<referrals>3</referrals>
</row>
<row>
<label>example.org/sub/dir/page2.html</label>
<referrals>2</referrals>
</row>
<row>
<label>Others</label>
<referrals>2</referrals>
</row>
</previousPages>
<previousSiteSearches>
<row>
<label>anotherkwd</label>
<referrals>1</referrals>
</row>
</previousSiteSearches>
<pageMetrics>
<loops>2</loops>
<pageviews>18</pageviews>
<entries>4</entries>
<exits>7</exits>
</pageMetrics>
<followingPages>
<row>
<label>example.org/the/third_page.html?foo=baz</label>
<referrals>3</referrals>
</row>
<row>
<label>example.org/sub/dir/page2.html</label>
<referrals>2</referrals>
</row>
<row>
<label>Others</label>
<referrals>3</referrals>
</row>
</followingPages>
<followingSiteSearches>
<row>
<label>anotherkwd</label>
<referrals>1</referrals>
</row>
</followingSiteSearches>
<outlinks>
<row>
<label>http://www.anothersite.com/to/outlink/page.html</label>
<referrals>1</referrals>
</row>
<row>
<label>http://anothersite.com/to/outlink/page2.html</label>
<referrals>1</referrals>
</row>
</outlinks>
<downloads>
<row>
<label>http://example.org/downloads/33.tar.gz</label>
<referrals>1</referrals>
</row>
<row>
<label>https://example.org/downloads/35.tar.gz</label>
<referrals>1</referrals>
</row>
</downloads>
<referrers>
<row>
<label>Direct Entries</label>
<shortName>direct</shortName>
<visits>1</visits>
<details>
</details>
</row>
<row>
<label>From Search Engines</label>
<shortName>search</shortName>
<visits>1</visits>
<details>
<row>
<label>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</label>
<referrals>1</referrals>
</row>
</details>
</row>
<row>
<label>From Websites</label>
<shortName>website</shortName>
<visits>1</visits>
<details>
<row>
<label>http://www.external.com.vn/referrerPage-counted.html</label>
<referrals>1</referrals>
</row>
</details>
</row>
<row>
<label>From Campaigns</label>
<shortName>campaign</shortName>
<visits>1</visits>
<details>
<row>
<label>testcampaign testkeyword</label>
<referrals>1</referrals>
</row>
</details>
</row>
</referrers>
</result>
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter