Skip to content

Commit

Permalink
Ensure LatestStable release channel uses the version provided from API (
Browse files Browse the repository at this point in the history
#22603)

* Ensure LatestStable release channel uses the version provided from API

* Adjust test and link in UI

* always download latest stable if no version provided
  • Loading branch information
sgiehl authored Sep 20, 2024
1 parent f9d5c28 commit 15bbb30
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
42 changes: 21 additions & 21 deletions plugins/CoreHome/vue/dist/CoreHome.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/CoreHome/vue/dist/CoreHome.umd.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default defineComponent({
let text = '';
if (this.isMultiServerEnvironment) {
const link = externalRawLink(`https://builds.matomo.org/piwik-${this.latestVersionAvailable}.zip`);
const link = externalRawLink(`https://builds.matomo.org/matomo-${this.latestVersionAvailable}.zip`);
text = translate(
'CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment',
`<a rel="noreferrer noopener" href="${link}">builds.matomo.org</a>`,
Expand Down
6 changes: 5 additions & 1 deletion plugins/CoreUpdater/ReleaseChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function getUrlToCheckForLatestAvailableVersion()

public function getDownloadUrlWithoutScheme($version)
{
return sprintf('://builds.matomo.org/piwik-%s.zip', $version);
if (!empty($version)) {
return sprintf('://builds.matomo.org/matomo-%s.zip', $version);
}

return '://builds.matomo.org/matomo.zip';
}
}
5 changes: 0 additions & 5 deletions plugins/CoreUpdater/ReleaseChannel/LatestStable.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public function getDescription()
return Piwik::translate('General_Recommended');
}

public function getDownloadUrlWithoutScheme($version)
{
return '://builds.matomo.org/matomo.zip';
}

public function getOrder()
{
return 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function setUp(): void

public function testGetDownloadUrlWithoutSchemeShouldReturnUrlWithVersionNumberButWithoutScheme()
{
$this->assertSame('://builds.matomo.org/piwik-2.15.0-b5.zip', $this->channel->getDownloadUrlWithoutScheme('2.15.0-b5'));
$this->assertSame('://builds.matomo.org/matomo-2.15.0-b5.zip', $this->channel->getDownloadUrlWithoutScheme('2.15.0-b5'));
}

public function testGetUrlToCheckForLatestAvailableVersion()
Expand Down

0 comments on commit 15bbb30

Please sign in to comment.