diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-77757-EnableRecheckingWhetherAnUpdateWizardShouldRun.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-77757-EnableRecheckingWhetherAnUpdateWizardShouldRun.rst new file mode 100644 index 0000000000000000000000000000000000000000..360043b39bb3d5364e90e27aaebcbfed3f561a2b --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-77757-EnableRecheckingWhetherAnUpdateWizardShouldRun.rst @@ -0,0 +1,14 @@ +.. include:: ../../Includes.txt + +====================================================================== +Feature: #77757 - Enable rechecking whether an UpdateWizard should run +====================================================================== + +See :issue:`77757` + +Description +=========== + +It is now possible to reset the upgrade wizards marked as done. In Install Tool you will find a list of wizards that has been marked as done, additionally with a checkbox for each to reset this mark. Then the wizard will be tested again, whether it needs to be executed again. + +.. index:: Backend \ No newline at end of file diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php b/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php index 34d6edf4319518cd4d84c46ddd7771e308160179..06af4302f959224c90d8f61d30a7a0afcd908f5f 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php +++ b/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Cache\DatabaseSchemaService; use TYPO3\CMS\Core\Database\Schema\Exception\StatementException; use TYPO3\CMS\Core\Database\Schema\SchemaMigrator; use TYPO3\CMS\Core\Database\Schema\SqlReader; +use TYPO3\CMS\Core\Registry; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\VersionNumberUtility; use TYPO3\CMS\Install\Controller\Action; @@ -92,6 +93,10 @@ class UpgradeWizard extends Action\AbstractAction } elseif (isset($this->postValues['set']['performUpdate'])) { $actionMessages[] = $this->performUpdate(); $this->view->assign('updateAction', 'performUpdate'); + } elseif (isset($this->postValues['set']['recheckWizards'])) { + $actionMessages[] = $this->recheckWizards(); + $this->listUpdates(); + $this->view->assign('updateAction', 'listUpdates'); } else { $this->listUpdates(); $this->view->assign('updateAction', 'listUpdates'); @@ -153,7 +158,11 @@ class UpgradeWizard extends Action\AbstractAction /** @var AbstractUpdate $updateObject */ $updateObject = $this->getUpdateObjectInstance($className, $identifier); if ($updateObject->shouldRenderWizard() !== true) { - $wizardsDone[] = $updateObject; + $doneWizard = [ + 'identifier' => $identifier, + 'title' => $updateObject->getTitle() + ]; + $wizardsDone[] = $doneWizard; } } $this->view->assign('wizardsDone', $wizardsDone); @@ -194,6 +203,28 @@ class UpgradeWizard extends Action\AbstractAction return $message; } + /** + * Rechecks whether the chosen wizards should be executed + * + * @return \TYPO3\CMS\Install\Status\StatusInterface + */ + protected function recheckWizards() + { + if (empty($this->postValues['values']['recheck'])) { + $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\NoticeStatus::class); + $message->setTitle('No wizards selected to recheck'); + return $message; + } + foreach ($this->postValues['values']['recheck'] as $wizardIdentifier => $value) { + $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier]; + $updateObject = $this->getUpdateObjectInstance($className, $wizardIdentifier); + GeneralUtility::makeInstance(Registry::class)->set('installUpdate', get_class($updateObject), 0); + } + $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\OkStatus::class); + $message->setTitle('Successfully rechecked'); + return $message; + } + /** * Perform update of a specific wizard * diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/ListUpdates.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/ListUpdates.html index 8e2d7b9eef88fe9f5b4583535f1119d3aa44799b..27ead4d547b934cfcd355a6823ee04843de2bf86 100644 --- a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/ListUpdates.html +++ b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/ListUpdates.html @@ -42,12 +42,28 @@ </f:if> <f:if condition="{wizardsDone}"> - <h2>Wizards done</h2> - <ul> - <f:for each="{wizardsDone}" as="wizardDone"> - <li>{wizardDone.title}</li> - </f:for> - </ul> + <form method="post"> + <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" /> + <h2>Wizards done</h2> + <table class="table table-striped"> + <tbody> + <f:for each="{wizardsDone}" as="wizardDone"> + <tr> + <td> + <input id="t3-recheck-{wizardDone.identifier}" type="checkbox" name="install[values][recheck][{wizardDone.identifier}]" value="1" /> + </td> + <td> + {wizardDone.title} + </td> + </tr> + </f:for> + </tbody> + </table> + <f:render + partial="Action/Common/SubmitButton" + arguments="{name:'recheckWizards', text:'Recheck chosen wizards'}" + /> + </form> </f:if> <hr />