[FEATURE] Add a check if TYPO3 version is maintained 11/35811/7
authorFrederic Gaus <gaus@flagbit.de>
Tue, 6 Jan 2015 08:08:51 +0000 (09:08 +0100)
committerMathias Schreiber <mathias.schreiber@wmdb.de>
Sat, 17 Jan 2015 22:51:37 +0000 (23:51 +0100)
Modifies the status report of the install tool. Currently only
bugfix releases are taken into account. With this patch the reports
module will also show an error when the minor version is outdated
(e.g. 7.0 after the 7.1 release)

Change-Id: Ia147d5a4233b225bba435af590f72b77024181fa
Releases: master
Resolves: #62649
Reviewed-on: http://review.typo3.org/35811
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
typo3/sysext/install/Classes/Report/InstallStatusReport.php
typo3/sysext/install/Classes/Service/CoreVersionService.php
typo3/sysext/install/Resources/Private/Language/Report/locallang.xlf

index 6c37eb0..ee86441 100644 (file)
@@ -172,22 +172,27 @@ class InstallStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
 
                try {
                        $isUpdateAvailable = $coreVersionService->isYoungerPatchReleaseAvailable();
+                       $isMaintainedVersion = $coreVersionService->isVersionActivelyMaintained();
                } catch (Exception\CoreVersionServiceException $coreVersionServiceException) {
                        return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, $GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_patchLevelNotFoundInReleaseMatrix'), Status::WARNING);
                }
 
-               if (!$isUpdateAvailable) {
+               if (!$isUpdateAvailable && $isMaintainedVersion) {
                        // Everything is fine, working with the latest version
                        return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, '', Status::OK);
-               }
-
-               // There is an update available
-               $newVersion = $coreVersionService->getYoungestPatchRelease();
-               if ($coreVersionService->isUpdateSecurityRelevant()) {
-                       return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, sprintf($GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_newVersionSecurityRelevant'), $newVersion), Status::ERROR);
+               } elseif ($isUpdateAvailable) {
+                       // There is an update available
+                       $newVersion = $coreVersionService->getYoungestPatchRelease();
+                       if ($coreVersionService->isUpdateSecurityRelevant()) {
+                               return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, sprintf($GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_newVersionSecurityRelevant'), $newVersion), Status::ERROR);
+                       } else {
+                               return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, sprintf($GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_newVersion'), $newVersion), Status::WARNING);
+                       }
                } else {
-                       return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, sprintf($GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_newVersion'), $newVersion), Status::WARNING);
+                       // Version is not maintained
+                       return GeneralUtility::makeInstance(Status::class, 'TYPO3', TYPO3_version, $GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_versionOutdated'), Status::ERROR);
                }
+
        }
 
 }
index aa42dee..06baefe 100644 (file)
@@ -119,6 +119,17 @@ class CoreVersionService {
        }
 
        /**
+        * Checks if TYPO3 version (e.g. 6.2) is an actively maintained version
+        *
+        * @return bool TRUE if version is actively maintained
+        */
+       public function isVersionActivelyMaintained() {
+               $minorVersion = $this->getInstalledMinorVersion();
+               $versionMatrix = $this->getVersionMatrix();
+               return (bool)$versionMatrix[$minorVersion]['active'];
+       }
+
+       /**
         * Returns TRUE if a younger patch level release exists in version matrix.
         *
         * @return bool TRUE if younger patch release is exists
@@ -321,4 +332,4 @@ class CoreVersionService {
                }
        }
 
-}
\ No newline at end of file
+}
index 8243031..3b9b1b3 100644 (file)
@@ -75,6 +75,9 @@
                        <trans-unit id="status_newVersion" xml:space="preserve">
                                <source>There is a new version of TYPO3 available. You can update to version %s</source>
                        </trans-unit>
+                       <trans-unit id="status_versionOutdated" xml:space="preserve">
+                               <source>The TYPO3 version you're using is not supported anymore. You should update to a supported version.</source>
+                       </trans-unit>
                        <trans-unit id="status_installToolPassword" xml:space="preserve">
                                <source>Install Tool Password</source>
                        </trans-unit>