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:
authorStefan Giehl <stefan@piwik.org>2016-10-05 00:10:14 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2016-10-05 00:10:14 +0300
commit1600c0b8d117468c6a9230bbbceabf53d548267e (patch)
treec8215b5fe2744a1931491991b1d92e0a59d282c8
parent74abd1cf33029750d86187c4bd5dffb751160e8e (diff)
Fix update script screwing up scheduled report data (#10680)2.16.5
* move fix of broken update script to 2.16.5 * increase version 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
-rw-r--r--core/Version.php2
3 files changed, 10 insertions, 6 deletions
diff --git a/core/Date.php b/core/Date.php
index f4a76cf0dc..43628cf93c 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);
}
}
diff --git a/core/Version.php b/core/Version.php
index f68077cc25..5d2fa32109 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -20,7 +20,7 @@ final class Version
* The current Piwik version.
* @var string
*/
- const VERSION = '2.16.4';
+ const VERSION = '2.16.5';
public function isStableVersion($version)
{