diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-04-20 13:02:35 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-04-20 13:02:36 +0400 |
commit | 35f975accb45152dd669e0009237eed3dc6ada2b (patch) | |
tree | 8a0a82519a8a3502ae18c31ae3db7bf2d148af55 /plugins/Transitions | |
parent | 6575c1f85e6d4276cbce2d8a22535c6d499cb8ce (diff) |
Fixes #3904:
* new segment 'siteSearchKeyword'
Fixes #3903, #3905:
* adding few fields in the Live API output to accomodate getSuggestedValuesForSegment
* renamed other fields for consistency with segment names
Fixes #3906:
* new API: getSuggestedValuesForSegment which returns top suggested values for a particular segment. It uses the Live.getLastVisitsDetails API to fetch the most recently used values, and will show the most used values first
* Adding tests for everything. The test case actually generates data for all segments so that VisitsSummary.get returns some data for each of the 47 segments being tested returns some data.
How it works:
* generate extended data in fixture
* Tests (1) call getSuggestedValuesForSegment for each segment, check there is some data returned for each segment
* get the first suggested value from the list,
* Tests (2) call VisitsSummary.get with this segment value, eg. countryCode==ru.
* I worked this way for all 47 segments until all tests had some data ==> now we know that all segments have been tested and that the auto suggest works for all segments. TDD FTW!
Diffstat (limited to 'plugins/Transitions')
-rw-r--r-- | plugins/Transitions/API.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php index 80afa16d94..4457d71046 100644 --- a/plugins/Transitions/API.php +++ b/plugins/Transitions/API.php @@ -134,25 +134,25 @@ class Piwik_Transitions_API case 'url': $originalActionName = $actionName; $actionName = Piwik_Common::unsanitizeInputValue($actionName); - $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_url'); + $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_url', Piwik_SegmentExpression::MATCH_EQUAL, 'pageUrl'); if ($id < 0) { // an example where this is needed is urls containing < or > $actionName = $originalActionName; - $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_url'); + $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_url', Piwik_SegmentExpression::MATCH_EQUALs, 'pageUrl'); } return $id; case 'title': - $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_name'); + $id = $actionsPlugin->getIdActionFromSegment($actionName, 'idaction_name', Piwik_SegmentExpression::MATCH_EQUAL, 'pageTitle'); if ($id < 0) { - $unkown = Piwik_Actions_ArchivingHelper::getUnknownActionName( + $unknown = Piwik_Actions_ArchivingHelper::getUnknownActionName( Piwik_Tracker_Action::TYPE_ACTION_NAME); - if (trim($actionName) == trim($unkown)) { - $id = $actionsPlugin->getIdActionFromSegment('', 'idaction_name'); + if (trim($actionName) == trim($unknown)) { + $id = $actionsPlugin->getIdActionFromSegment('', 'idaction_name', Piwik_SegmentExpression::MATCH_EQUAL, 'pageTitle'); } } |