[BUGFIX] Fix fatal in ReportsModule with upgrade wizards 13/58213/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 12:39:46 +0000 (14:39 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 13:22:25 +0000 (15:22 +0200)
With the new upgrade wizard API the InstallStatusReport
has to be adapted a bit to prevent a fatal calling
shouldRenderWizard() on wizards that don't have this
method.

Resolves: #86183
Releases: master
Change-Id: I0551c0a823a0a6f670c0ca079a1f2f4475ccf583
Reviewed-on: https://review.typo3.org/58213
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Reviewed-by: rolandgolla <rolandgolla@gmail.com>
Tested-by: rolandgolla <rolandgolla@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/Report/InstallStatusReport.php

index fd2ff5d..36a0d02 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Install\Service\Exception;
+use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
 use TYPO3\CMS\Reports\Status;
 
 /**
@@ -152,16 +153,24 @@ class InstallStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
         // check if there are update wizards left to perform
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'])) {
             $versionAsInt = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+            $incompleteWizardFound = false;
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
                 $updateObject = GeneralUtility::makeInstance($className, $identifier, $versionAsInt, null, $this);
-                if ($updateObject->shouldRenderWizard()) {
-                    // at least one wizard was found
-                    $value = $languageService->getLL('status_updateIncomplete');
-                    $severity = Status::WARNING;
-                    $url = (string)$uriBuilder->buildUriFromRoute('tools_toolsupgrade');
-                    $message = sprintf($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.install_update'), '<a href="' . htmlspecialchars($url) . '">', '</a>');
+                if (method_exists($updateObject, 'shouldRenderWizard') && $updateObject->shouldRenderWizard()) {
+                    $incompleteWizardFound = true;
                     break;
                 }
+                if ($updateObject instanceof UpgradeWizardInterface && $updateObject->updateNecessary()) {
+                    $incompleteWizardFound = true;
+                    break;
+                }
+            }
+            if ($incompleteWizardFound) {
+                // At least one incomplete wizard was found
+                $value = $languageService->getLL('status_updateIncomplete');
+                $severity = Status::WARNING;
+                $url = (string)$uriBuilder->buildUriFromRoute('tools_toolsupgrade');
+                $message = sprintf($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.install_update'), '<a href="' . htmlspecialchars($url) . '">', '</a>');
             }
         }