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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-12-30 06:18:58 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-01-05 05:27:54 +0300
commit16d531f9b78ee18105a43741b308e04f4fdde673 (patch)
tree6ead62e280c884976ff27b0ca7cf79621ea6935e /plugins/API/API.php
parentcf57593289658608ff372dc9c15309d4ab493fe4 (diff)
Fix tests for CSV export
Diffstat (limited to 'plugins/API/API.php')
-rw-r--r--plugins/API/API.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php
index be03396f68..8c19b0a9b8 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -323,9 +323,11 @@ class API extends \Piwik\Plugin\API
public function getMetadata($idSite, $apiModule, $apiAction, $apiParameters = array(), $language = false,
$period = false, $date = false, $hideMetricsDoc = false, $showSubtableReports = false)
{
- /** @var Translator $translator */
- $translator = StaticContainer::getContainer()->get('Piwik\Translation\Translator');
- $translator->setCurrentLanguage($language);
+ if ($language) {
+ /** @var Translator $translator */
+ $translator = StaticContainer::getContainer()->get('Piwik\Translation\Translator');
+ $translator->setCurrentLanguage($language);
+ }
$reporter = new ProcessedReport();
$metadata = $reporter->getMetadata($idSite, $apiModule, $apiAction, $apiParameters, $language, $period, $date, $hideMetricsDoc, $showSubtableReports);