Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbenakamoorthi <benaka.moorthi@gmail.com>2012-11-21 11:23:34 +0400
committerbenakamoorthi <benaka.moorthi@gmail.com>2012-11-21 11:23:34 +0400
commit706f6d647ac56e6d105d2fadf0358dbbc6544158 (patch)
tree5c2aaf7170944357efa62ad515ce1a3834fce8f9
parente31919a4ea1fc1f7387d653e8452431a5efbe23b (diff)
Fixes #3440, make sure Actions metrics are associated w/ an Actions report in Piwik_Archive_Single::getRequestedReportFor and make sure Piwik_VisitsSummary_Controller::getVisitsSummary can handle case where Piwik_API_Request returns false.
git-svn-id: http://dev.piwik.org/svn/trunk@7500 59fd770c-687e-43c8-a1e3-f5a4ff64c105
-rw-r--r--core/Archive.php28
-rw-r--r--core/Archive/Single.php8
-rw-r--r--core/ArchiveProcessing.php3
-rw-r--r--plugins/VisitsSummary/Controller.php3
4 files changed, 39 insertions, 3 deletions
diff --git a/core/Archive.php b/core/Archive.php
index cec56105f0..082c4fa00a 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -156,6 +156,34 @@ abstract class Piwik_Archive
'sum_daily_nb_uniq_visitors' => Piwik_Archive::INDEX_SUM_DAILY_NB_UNIQ_VISITORS,
);
+ /**
+ * Metrics calculated and archived by the Actions plugin.
+ *
+ * @var array
+ */
+ public static $actionsMetrics = array(
+ 'nb_pageviews',
+ 'nb_uniq_pageviews',
+ 'nb_downloads',
+ 'nb_uniq_downloads',
+ 'nb_outlinks',
+ 'nb_uniq_outlinks',
+ 'nb_searches',
+ 'nb_keywords',
+ 'nb_hits',
+ 'sum_time_spent',
+ 'exit_nb_uniq_visitors',
+ 'exit_nb_visits',
+ 'sum_daily_exit_nb_uniq_visitors',
+ 'entry_nb_uniq_visitors',
+ 'sum_daily_entry_nb_uniq_visitors',
+ 'entry_nb_visits',
+ 'entry_nb_actions',
+ 'entry_sum_visit_length',
+ 'entry_bounce_count',
+ 'nb_hits_following_search',
+ );
+
const LABEL_ECOMMERCE_CART = 'ecommerceAbandonedCart';
const LABEL_ECOMMERCE_ORDER = 'ecommerceOrder';
diff --git a/core/Archive/Single.php b/core/Archive/Single.php
index 87b17688a8..74c64218ce 100644
--- a/core/Archive/Single.php
+++ b/core/Archive/Single.php
@@ -593,7 +593,13 @@ class Piwik_Archive_Single extends Piwik_Archive
{
return 'Goals_Metrics';
}
- return $metric;
+ // Actions metrics are processed by the Actions plugin (HACK) (3RD HACK IN FACT) (YES, THIS IS TOO MUCH HACKING)
+ // (FIXME PLEASE).
+ if (in_array($metric, Piwik_Archive::$actionsMetrics))
+ {
+ return 'Actions_Metrics';
+ }
+ return $metric;
}
/**
diff --git a/core/ArchiveProcessing.php b/core/ArchiveProcessing.php
index 7436d6e3b7..e908385d91 100644
--- a/core/ArchiveProcessing.php
+++ b/core/ArchiveProcessing.php
@@ -662,7 +662,8 @@ abstract class Piwik_ArchiveProcessing
if(empty($plugin)
|| !Piwik_PluginsManager::getInstance()->isPluginActivated($plugin))
{
- throw new Exception("Error: The report '$requestedReport' was requested but it is not available at this stage. You may also disable the related plugin to avoid this error.");
+ $pluginStr = empty($plugin) ? '' : "($plugin)";
+ throw new Exception("Error: The report '$requestedReport' was requested but it is not available at this stage. You may also disable the related plugin $pluginStr to avoid this error.");
}
return $plugin;
}
diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php
index daa79709f1..de0079d51a 100644
--- a/plugins/VisitsSummary/Controller.php
+++ b/plugins/VisitsSummary/Controller.php
@@ -95,7 +95,8 @@ class Piwik_VisitsSummary_Controller extends Piwik_Controller
// by a method that already calls the API with some generic filters applied
"&disable_generic_filters=1";
$request = new Piwik_API_Request($requestString);
- return $request->process();
+ $result = $request->process();
+ return empty($result) ? new Piwik_DataTable() : $result;
}
static public function getVisits()