diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-04-09 06:43:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 06:43:07 +0300 |
commit | 259636154945c2f70571e6e5651a98791c7a4044 (patch) | |
tree | 4d64eb59c9c0bc0cbeb4ad88e6b8f57eaaf2e53e /plugins/CoreUpdater/ReleaseChannel | |
parent | 2c5c72e2da4c015efa78069c9c1b407fc55a6483 (diff) |
Make sure upgrading from a 3.X or pre- version to 4.X via oneclickupdate works (#15795)
* couple fixes for updating via one-click-update to 4.0
* Fix for updating from 3.x => greater through oneclickupdate (in one case Piwik\Transient\Cache is loaded).
Diffstat (limited to 'plugins/CoreUpdater/ReleaseChannel')
-rw-r--r-- | plugins/CoreUpdater/ReleaseChannel/LatestCurrentBeta.php | 6 | ||||
-rw-r--r-- | plugins/CoreUpdater/ReleaseChannel/LatestCurrentStable.php | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/plugins/CoreUpdater/ReleaseChannel/LatestCurrentBeta.php b/plugins/CoreUpdater/ReleaseChannel/LatestCurrentBeta.php index 93767a12f8..bdfb20f0e3 100644 --- a/plugins/CoreUpdater/ReleaseChannel/LatestCurrentBeta.php +++ b/plugins/CoreUpdater/ReleaseChannel/LatestCurrentBeta.php @@ -16,12 +16,14 @@ class LatestCurrentBeta extends ReleaseChannel { public function getId() { - return 'latest_'. Version::MAJOR_VERSION . 'x_beta'; + // NOTE: using Version::VERSION instead of Version::MAJOR_VERSION since MAJOR_VERSION may not exist when + // updating from pre 4.x to 4.x. + return 'latest_'. ((int) Version::VERSION) . 'x_beta'; } public function getName() { - return Piwik::translate('CoreUpdater_LatestXBetaRelease', Version::MAJOR_VERSION . '.X'); + return Piwik::translate('CoreUpdater_LatestXBetaRelease', ((int) Version::VERSION) . '.X'); } public function getDescription() diff --git a/plugins/CoreUpdater/ReleaseChannel/LatestCurrentStable.php b/plugins/CoreUpdater/ReleaseChannel/LatestCurrentStable.php index acbd9014ed..bb07555c58 100644 --- a/plugins/CoreUpdater/ReleaseChannel/LatestCurrentStable.php +++ b/plugins/CoreUpdater/ReleaseChannel/LatestCurrentStable.php @@ -16,12 +16,14 @@ class LatestCurrentStable extends ReleaseChannel { public function getId() { - return 'latest_'.Version::MAJOR_VERSION.'x_stable'; + // NOTE: using Version::VERSION instead of Version::MAJOR_VERSION since MAJOR_VERSION may not exist when + // updating from pre 4.x to 4.x. + return 'latest_'.((int) Version::VERSION).'x_stable'; } public function getName() { - return Piwik::translate('CoreUpdater_LatestXStableRelease', Version::MAJOR_VERSION . '.X'); + return Piwik::translate('CoreUpdater_LatestXStableRelease', ((int) Version::VERSION) . '.X'); } public function getDescription() |