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) (#22656)

* 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 Oct 10, 2024
1 parent 6ed86b0 commit 4a396f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 5 additions & 1 deletion plugins/CoreUpdater/ReleaseChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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 @@ -28,11 +28,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 @@ -48,7 +48,7 @@ public function setUp(): void

public function test_getDownloadUrlWithoutScheme_shouldReturnUrlWithVersionNumberButWithoutScheme()
{
$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 test_getUrlToCheckForLatestAvailableVersion()
Expand Down

0 comments on commit 4a396f6

Please sign in to comment.