Commit af366467 authored by Thomas Löffler's avatar Thomas Löffler

Fix LTS version checker in Solr indexer and detail view

parent 987c69d7
Pipeline #8780 passed with stages
in 11 minutes and 19 seconds
......@@ -1168,9 +1168,10 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
$currentStableVersions = $ltsVersionService->getCurrentStableVersions(true);
$this->getSupportedTypo3Versions($supportedTypo3Versions, $currentStableVersions, 'success');
if ($this->doesSupportTypo3Version($ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportedTypo3Versions[$ltsVersionService->getVersionLabelOfRelease($ltsVersionService->getLatestDevelopmentVersion(true))] = [
'label' => $ltsVersionService->getVersionLabelOfRelease($ltsVersionService->getLatestDevelopmentVersion(true)) . '-dev',
$latestDevelopmentVersion = $ltsVersionService->getLatestDevelopmentVersion(true);
if ($this->doesSupportTypo3Version($latestDevelopmentVersion) && !in_array($latestDevelopmentVersion, $currentStableVersions, true)) {
$supportedTypo3Versions[$ltsVersionService->getVersionLabelOfRelease($latestDevelopmentVersion)] = [
'label' => $ltsVersionService->getVersionLabelOfRelease($latestDevelopmentVersion) . '-dev',
'badgeClass' => 'info'
];
}
......
......@@ -253,6 +253,6 @@ class LTSVersionService
$firstRelease = (int)($versionNumber / self::FACTOR_MINOR_VERSION) * self::FACTOR_MINOR_VERSION;
$mainVersion = (int)($firstRelease / self::FACTOR_MAIN_VERSION);
return ($mainVersion >= self::FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER && $mainVersion < $this->getLatestDevelopmentVersion()) || in_array($firstRelease, $this->ltsVersionsWithMinorVersions, true);
return ($mainVersion >= self::FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER && $mainVersion <= $this->getLatestDevelopmentVersion()) || in_array($firstRelease, $this->ltsVersionsWithMinorVersions, true);
}
}
......@@ -120,7 +120,8 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer
$supportMaintainedVersions[] = $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS';
}
}
if ($ltsVersionService->getLatestDevelopmentVersion() !== $ltsVersionService->coreData['latest_lts'] && VersionUtility::doesExtensionSupportTypo3Version($extension, $ltsVersionService->getLatestDevelopmentVersion(true))) {
if ($ltsVersionService->getLatestDevelopmentVersion(true) > VersionNumberUtility::convertVersionNumberToInteger($ltsVersionService->coreData['latest_lts'])
&& VersionUtility::doesExtensionSupportTypo3Version($extension, $ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportDevVersion = $ltsVersionService->getLatestDevelopmentVersion() . '-dev';
}
foreach ($ltsVersionService->getELTSVersions() as $versionNumber) {
......
......@@ -46,7 +46,7 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getCurrentStableVersions()
{
self::assertSame(['8', '9'], $this->subject->getCurrentStableVersions());
self::assertSame(['8', '9', '10'], $this->subject->getCurrentStableVersions());
}
/**
......@@ -54,7 +54,7 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getCurrentStableVersionsAsFullVersionNumber()
{
self::assertSame([8007000, 9005000], $this->subject->getCurrentStableVersions(true));
self::assertSame([8007000, 9005000, 10000000], $this->subject->getCurrentStableVersions(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