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:
authorsgiehl <stefan@piwik.org>2016-10-04 23:39:44 +0300
committersgiehl <stefan@piwik.org>2016-10-05 00:05:32 +0300
commitb8d15f6e8db5fa09811884d9eab0ad67190d8f55 (patch)
tree435fc9134c2fc3ef3f95a438d7d3889f67b927ad
parentd3c5f504e2f51e652d27215ce74c1b92e71c903b (diff)
move fix of broken update script to 2.16.5
-rw-r--r--core/Date.php6
-rw-r--r--core/Updates/2.16.5.php (renamed from core/Updates/2.16.3-b3.php)8
2 files changed, 9 insertions, 5 deletions
diff --git a/core/Date.php b/core/Date.php
index 8922ed8ac2..dd2051a1a0 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -258,7 +258,7 @@ class Date
}
/**
- * Converts a timestamp in a from UTC to a timezone.
+ * Converts a timestamp from UTC to a timezone.
*
* @param int $timestamp The UNIX timestamp to adjust.
* @param string $timezone The timezone to adjust to.
@@ -266,6 +266,10 @@ class Date
*/
public static function adjustForTimezone($timestamp, $timezone)
{
+ if (empty($timezone)) {
+ return $timestamp;
+ }
+
// manually adjust for UTC timezones
$utcOffset = self::extractUtcOffset($timezone);
if ($utcOffset !== false) {
diff --git a/core/Updates/2.16.3-b3.php b/core/Updates/2.16.5.php
index ba57839d57..c5aef85066 100644
--- a/core/Updates/2.16.3-b3.php
+++ b/core/Updates/2.16.5.php
@@ -16,19 +16,19 @@ use Piwik\Updater;
use Piwik\Updates as PiwikUpdates;
/**
- * Update for version 2.16.3-b3.
+ * Update for version 2.16.5.
*
* Update existing scheduled reports to use UTC timezone for hour setting
*/
-class Updates_2_16_3_b3 extends PiwikUpdates
+class Updates_2_16_5 extends PiwikUpdates
{
public function doUpdate(Updater $updater)
{
$model = new ScheduledReportsModel();
$allReports = ScheduledReportsAPI::getInstance()->getReports();
foreach ($allReports as $report) {
- $report['hour'] = $this->adjustTimezoneBySite($report['hour'], $report['idsite']);
- $model->updateReport($report['idreport'], $report);
+ $update = array('hour' => $this->adjustTimezoneBySite($report['hour'], $report['idsite']));
+ $model->updateReport($report['idreport'], $update);
}
}