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:
-rw-r--r--core/API/DataTableManipulator.php8
-rw-r--r--core/Profiler.php19
-rw-r--r--core/Tracker/GoalManager.php9
-rw-r--r--core/Tracker/Referrer.php2
-rw-r--r--plugins/CoreConsole/Commands/GenerateTest.php2
5 files changed, 33 insertions, 7 deletions
diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php
index b000c933a2..243f050c7f 100644
--- a/core/API/DataTableManipulator.php
+++ b/core/API/DataTableManipulator.php
@@ -151,6 +151,14 @@ abstract class DataTableManipulator
{
if (!$this->apiMethodForSubtable) {
$meta = API::getInstance()->getMetadata('all', $this->apiModule, $this->apiMethod);
+
+ if(empty($meta)) {
+ throw new Exception(sprintf(
+ "The DataTable cannot be manipulated: Metadata for report %s.%s could not be found. You can define the metadata in a hook, see example at: http://developer.piwik.org/api-reference/hooks#apigetreportmetadata",
+ $this->apiModule, $this->apiMethod
+ ));
+ }
+
if (isset($meta[0]['actionToLoadSubTables'])) {
$this->apiMethodForSubtable = $meta[0]['actionToLoadSubTables'];
} else {
diff --git a/core/Profiler.php b/core/Profiler.php
index 712c0e27eb..d4141f472c 100644
--- a/core/Profiler.php
+++ b/core/Profiler.php
@@ -200,6 +200,10 @@ class Profiler
return;
}
+ if(!function_exists('xhprof_enable')) {
+ return;
+ }
+
require_once $path;
require_once PIWIK_INCLUDE_PATH . '/tests/lib/xhprof-0.9.4/xhprof_lib/utils/xhprof_lib.php';
@@ -234,17 +238,22 @@ class Profiler
if($mainRun) {
$runIds = implode(',', $runs);
- $out = "\n\nHere is the profiler URL aggregating all runs triggered from this process: ";
+ $out = "\n\n";
$baseUrl = "http://" . @$_SERVER['HTTP_HOST'] . "/" . @$_SERVER['REQUEST_URI'];
$baseUrlStored = SettingsPiwik::getPiwikUrl();
if(strlen($baseUrlStored) > strlen($baseUrl)) {
$baseUrl = $baseUrlStored;
}
- $baseUrl = "\n\n" . $baseUrl
+ $baseUrl = "\n" . $baseUrl
."tests/lib/xhprof-0.9.4/xhprof_html/?source=$profilerNamespace&run=";
- $out .= $baseUrl . "$runIds\n\n";
- $out .= "Main run profile:";
- $out .= $baseUrl . "$runId\n\n";
+
+ $out .= "Profiler report is available at:";
+ $out .= $baseUrl . $runId;
+ if($runId != $runIds) {
+ $out .= "\n\nProfiler Report aggregating all runs triggered from this process: ";
+ $out .= $baseUrl . $runIds;
+ }
+ $out .= "\n\n";
echo ($out);
} else {
self::setProfilingRunIds($runs);
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index 91560fe43c..662f86a445 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -789,6 +789,15 @@ class GoalManager
*/
protected function insertNewConversion($newGoal)
{
+ /**
+ * This hook is called before inserting a new Goal Conversion.. You can use it to update the Goal
+ * attributes before they are saved in the log_conversion table.
+ * `$visitor` contains the current known visit information.
+ * @param array $goal Array of SQL fields value for this conversion, will be inserted in the log_conversion table
+ * @param \Piwik\Tracker\Request $request
+ */
+ Piwik::postEvent('Tracker.newConversionInformation', array($newGoal, $this->request));
+
$newGoalDebug = $newGoal;
$newGoalDebug['idvisitor'] = bin2hex($newGoalDebug['idvisitor']);
Common::printDebug($newGoalDebug);
diff --git a/core/Tracker/Referrer.php b/core/Tracker/Referrer.php
index 14cff1d41e..983c969535 100644
--- a/core/Tracker/Referrer.php
+++ b/core/Tracker/Referrer.php
@@ -103,7 +103,7 @@ class Referrer
&& !$referrerDetected
) {
$this->typeReferrerAnalyzed = Common::REFERRER_TYPE_WEBSITE;
- $this->nameReferrerAnalyzed = mb_strtolower($this->referrerHost, 'UTF-8');
+ $this->nameReferrerAnalyzed = Common::mb_strtolower($this->referrerHost);
}
$referrerInformation = array(
diff --git a/plugins/CoreConsole/Commands/GenerateTest.php b/plugins/CoreConsole/Commands/GenerateTest.php
index 82b864e2fc..3b96551440 100644
--- a/plugins/CoreConsole/Commands/GenerateTest.php
+++ b/plugins/CoreConsole/Commands/GenerateTest.php
@@ -174,7 +174,7 @@ class GenerateTest extends GeneratePluginBase
if (empty($testtype)) {
$dialog = $this->getHelperSet()->get('dialog');
- $testtype = $dialog->askAndValidate($output, 'Enter the type of the test to generate: ', $validate);
+ $testtype = $dialog->askAndValidate($output, 'Enter the type of the test to generate ('. implode(", ", $this->getValidTypes()).'): ', $validate);
} else {
$validate($testtype);
}