Commit 9e91e145 authored by Tomas Norre Mikkelsen's avatar Tomas Norre Mikkelsen

Merge branch 'bugfix/wrong-supported-versions' into 'develop'

Fix version number check for supported TYPO3 versions

See merge request !464
parents 1a059354 e51c134d
Pipeline #8445 passed with stages
in 7 minutes
......@@ -1183,8 +1183,9 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
// reset from e.g. 7.6.21 to 7.6.0 for valid check
$resetMinimumVersion = (int)($this->getTypo3Dependency()->getMinimumVersion() / \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION) * \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION;
$resetVersionNumber = (int)($versionNumber / \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION) * \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION;
$supportsTypo3Version = $resetMinimumVersion <= $versionNumber && $this->getTypo3Dependency()->getMaximumVersion() >= $versionNumber;
$supportsTypo3Version = $resetMinimumVersion <= $versionNumber && $this->getTypo3Dependency()->getMaximumVersion() >= $resetVersionNumber;
if ($supportsTypo3Version) {
return true;
......@@ -1197,9 +1198,8 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
$ltsVersionService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
foreach ($versions as $versionNumber) {
$mainVersion = floor($versionNumber / $ltsVersionService::FACTOR_MINOR_VERSION * $ltsVersionService::FACTOR_MINOR_VERSION);
$label = $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS';
if ($this->doesSupportTypo3Version($mainVersion)) {
if ($this->doesSupportTypo3Version($versionNumber)) {
$supportedTypo3Versions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = [
'label' => $label,
'badgeClass' => $badgeClass
......
......@@ -53,12 +53,7 @@ class VersionUtility
continue;
}
// reset from e.g. 7.6.21 to 7.6.0 for valid check
$resetMinimumVersion = (int)($version->getTypo3Dependency()->getMinimumVersion() / 1000) * 1000;
$supportsTypo3Version = $resetMinimumVersion <= $mainVersion && $version->getTypo3Dependency()->getMaximumVersion() >= $mainVersion;
if ($supportsTypo3Version) {
if ($version->doesSupportTypo3Version($mainVersion)) {
return true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment