[TASK] Rename update wizard to upgrade wizard 17/27617/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 13 Feb 2014 16:59:28 +0000 (17:59 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 25 Feb 2014 12:51:23 +0000 (13:51 +0100)
For the release of TYPO3 4.5 that the wizard in
install tool was renamed to "Upgrade Wizard"
to distinguish between patch level updates and
major version upgrades.

During the refactoring of the install tool for 6.2
the wizard was named "Update wizard again"

Fix the name again and name the upgrade wizard
"Upgrade Wizard" again.

Releases: 6.2
Resolves: #55970
Change-Id: I2cc75b7dfc5ddb3889a080270bf90a101fed935a
Reviewed-on: https://review.typo3.org/27617
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
17 files changed:
typo3/sysext/install/Classes/Controller/Action/Tool/UpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/ToolController.php
typo3/sysext/install/Classes/Updates/CompatVersionUpdate.php
typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/GetUserInput.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/ListUpdates.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/PerformUpdate.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/GetUserInput.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/ListUpdates.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/PerformUpdate.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpdateWizard.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpgradeWizard.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/Welcome.html
typo3/sysext/install/Resources/Public/Images/Menu/UpdateWizard.png [deleted file]
typo3/sysext/install/Resources/Public/Images/Menu/UpgradeWizard.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/Install.css

diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/UpdateWizard.php b/typo3/sysext/install/Classes/Controller/Action/Tool/UpdateWizard.php
deleted file mode 100644 (file)
index 94a9743..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Controller\Action\Tool;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-use TYPO3\CMS\Install\Controller\Action;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Handle update wizards
- */
-class UpdateWizard extends Action\AbstractAction implements Action\ActionInterface {
-
-       /**
-        * Handle this action
-        *
-        * @return string content
-        */
-       public function handle() {
-               $this->initializeHandle();
-
-               // ext_localconf, db and ext_tables must be loaded for the upgrade wizards
-               $this->loadExtLocalconfDatabaseAndExtTables();
-
-               // Perform silent cache framework table upgrades
-               $this->silentCacheFrameworkTableSchemaMigration();
-
-               $actionMessages = array();
-
-               if (isset($this->postValues['set']['getUserInput'])) {
-                       $actionMessages[] = $this->getUserInputForUpdateWizard();
-                       $this->view->assign('updateAction', 'getUserInput');
-               } elseif (isset($this->postValues['set']['performUpdate'])) {
-                       $actionMessages[] = $this->performUpdate();
-                       $this->view->assign('updateAction', 'performUpdate');
-               } else {
-                       $actionMessages[] = $this->listUpdates();
-                       $this->view->assign('updateAction', 'listUpdates');
-               }
-
-               $this->view->assign('actionMessages', $actionMessages);
-
-               return $this->view->render();
-       }
-
-       /**
-        * List of available updates
-        *
-        * @return \TYPO3\CMS\Install\Status\StatusInterface
-        */
-       protected function listUpdates() {
-               if (empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'])) {
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
-                       $message->setTitle('No update wizards registered');
-                       return $message;
-               }
-
-               $availableUpdates = array();
-               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
-                       $updateObject = $this->getUpgradeObjectInstance($className, $identifier);
-                       if ($updateObject->shouldRenderWizard()) {
-                               // $explanation is changed by reference in upgrade objects!
-                               $explanation = '';
-                               $updateObject->checkForUpdate($explanation);
-                               $availableUpdates[$identifier] = array(
-                                       'identifier' => $identifier,
-                                       'title' => $updateObject->getTitle(),
-                                       'explanation' => $explanation,
-                                       'renderNext' => FALSE,
-                               );
-                               // There are upgrade wizards that only show text and don't want to be executed
-                               if ($updateObject->shouldRenderNextButton()) {
-                                       $availableUpdates[$identifier]['renderNext'] = TRUE;
-                               }
-                       }
-               }
-
-               $this->view->assign('availableUpdates', $availableUpdates);
-
-               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
-               $message->setTitle('Show available update wizards');
-               return $message;
-       }
-
-       /**
-        * Get user input of update wizard
-        *
-        * @return \TYPO3\CMS\Install\Status\StatusInterface
-        */
-       protected function getUserInputForUpdateWizard() {
-               $wizardIdentifier = $this->postValues['values']['identifier'];
-
-               $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier];
-               $updateObject = $this->getUpgradeObjectInstance($className, $wizardIdentifier);
-               $wizardHtml = '';
-               if (method_exists($updateObject, 'getUserInput')) {
-                       $wizardHtml = $updateObject->getUserInput('install[values][' . $wizardIdentifier . ']');
-               }
-
-               $updateWizardData = array(
-                       'identifier' => $wizardIdentifier,
-                       'title' => $updateObject->getTitle(),
-                       'wizardHtml' => $wizardHtml,
-               );
-
-               $this->view->assign('updateWizardData', $updateWizardData);
-
-               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
-               $message->setTitle('Show wizard options');
-               return $message;
-       }
-
-       /**
-        * Perform update of a specific wizard
-        *
-        * @throws \TYPO3\CMS\Install\Exception
-        * @return \TYPO3\CMS\Install\Status\StatusInterface
-        */
-       protected function performUpdate() {
-               $this->getDatabase()->store_lastBuiltQuery = TRUE;
-
-               $wizardIdentifier = $this->postValues['values']['identifier'];
-               $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier];
-               $updateObject = $this->getUpgradeObjectInstance($className, $wizardIdentifier);
-
-               $wizardData = array(
-                       'identifier' => $wizardIdentifier,
-                       'title' => $updateObject->getTitle(),
-               );
-
-               // $wizardInputErrorMessage is given as reference to wizard object!
-               $wizardInputErrorMessage = '';
-               if (method_exists($updateObject, 'checkUserInput') && !$updateObject->checkUserInput($wizardInputErrorMessage)) {
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Input parameter broken');
-                       $message->setMessage($wizardInputErrorMessage ?: 'Something went wrong!');
-                       $wizardData['wizardInputBroken'] = TRUE;
-               } else {
-                       if (!method_exists($updateObject, 'performUpdate')) {
-                               throw new \TYPO3\CMS\Install\Exception(
-                                       'No performUpdate method in update wizard with identifier ' . $wizardIdentifier,
-                                       1371035200
-                               );
-                       }
-
-                       // Both variables are used by reference in performUpdate()
-                       $customOutput = '';
-                       $databaseQueries = array();
-                       $performResult = $updateObject->performUpdate($databaseQueries, $customOutput);
-
-                       if ($performResult) {
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
-                               $message->setTitle('Update successful');
-                       } else {
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Update failed!');
-                               if ($customOutput) {
-                                       $message->setMessage($customOutput);
-                               }
-                       }
-
-                       if ($this->postValues['values']['showDatabaseQueries'] == 1) {
-                               $wizardData['queries'] = $databaseQueries;
-                       }
-               }
-
-               $this->view->assign('wizardData', $wizardData);
-
-               $this->getDatabase()->store_lastBuiltQuery = FALSE;
-
-               // Next update wizard, if available
-               $nextUpdateWizard = $this->getNextUpdateWizardInstance($updateObject);
-               $nextUpdateWizardIdentifier = '';
-               if ($nextUpdateWizard) {
-                       $nextUpdateWizardIdentifier = $nextUpdateWizard->getIdentifier();
-               }
-               $this->view->assign('nextUpdateWizardIdentifier', $nextUpdateWizardIdentifier);
-
-               return $message;
-       }
-
-       /**
-        * Creates instance of an upgrade object, setting the pObj, versionNumber and userInput
-        *
-        * @param string $className The class name
-        * @param string $identifier The identifier of upgrade object - needed to fetch user input
-        * @return object Newly instantiated upgrade object
-        */
-       protected function getUpgradeObjectInstance($className, $identifier) {
-               $formValues = $this->postValues;
-               $updateObject = GeneralUtility::getUserObj($className);
-               $updateObject->setIdentifier($identifier);
-               $updateObject->versionNumber = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
-               $updateObject->pObj = $this;
-               $updateObject->userInput = $formValues['values'][$identifier];
-               return $updateObject;
-       }
-
-       /**
-        * Returns the next upgrade wizard object
-        * Used to show the link/button to the next upgrade wizard
-        *
-        * @param object $currentObj Current update wizard object
-        * @return mixed Upgrade wizard instance or FALSE
-        */
-       protected function getNextUpdateWizardInstance($currentObj) {
-               $isPreviousRecord = TRUE;
-               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
-                       // Find the current update wizard, and then start validating the next ones
-                       if ($currentObj->getIdentifier() == $identifier) {
-                               $isPreviousRecord = FALSE;
-                               continue;
-                       }
-                       if (!$isPreviousRecord) {
-                               $nextUpdateWizard = $this->getUpgradeObjectInstance($className, $identifier);
-                               if ($nextUpdateWizard->shouldRenderWizard()) {
-                                       return $nextUpdateWizard;
-                               }
-                       }
-               }
-               return FALSE;
-       }
-
-       /**
-        * Force creation / update of caching framework tables that are needed by some update wizards
-        *
-        * @TODO: See also the other remarks on this topic in the abstract class, this whole area needs improvements
-        * @return void
-        */
-       protected function silentCacheFrameworkTableSchemaMigration() {
-               /** @var $sqlHandler \TYPO3\CMS\Install\Service\SqlSchemaMigrationService */
-               $sqlHandler = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
-
-               /** @var \TYPO3\CMS\Install\Service\CachingFrameworkDatabaseSchemaService $cachingFrameworkDatabaseSchemaService */
-               $cachingFrameworkDatabaseSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\CachingFrameworkDatabaseSchemaService');
-               $expectedSchemaString = $cachingFrameworkDatabaseSchemaService->getCachingFrameworkRequiredDatabaseSchema();
-               $cleanedExpectedSchemaString = implode(LF, $sqlHandler->getStatementArray($expectedSchemaString, TRUE, '^CREATE TABLE '));
-               $neededTableDefinition = $sqlHandler->getFieldDefinitions_fileContent($cleanedExpectedSchemaString);
-               $currentTableDefinition = $sqlHandler->getFieldDefinitions_database();
-               $updateTableDefinition = $sqlHandler->getDatabaseExtra($neededTableDefinition, $currentTableDefinition);
-               $updateStatements = $sqlHandler->getUpdateSuggestions($updateTableDefinition);
-               if (isset($updateStatements['create_table']) && count($updateStatements['create_table']) > 0) {
-                       $sqlHandler->performUpdateQueries($updateStatements['create_table'], $updateStatements['create_table']);
-               }
-               if (isset($updateStatements['add']) && count($updateStatements['add']) > 0) {
-                       $sqlHandler->performUpdateQueries($updateStatements['add'], $updateStatements['add']);
-               }
-               if (isset($updateStatements['change']) && count($updateStatements['change']) > 0) {
-                       $sqlHandler->performUpdateQueries($updateStatements['change'], $updateStatements['change']);
-               }
-       }
-
-       /**
-        * Overwrite getDatabase method of abstract!
-        *
-        * Returns $GLOBALS['TYPO3_DB'] directly, since this global is instantiated properly in update wizards
-        *
-        * @return \TYPO3\CMS\Core\Database\DatabaseConnection
-        */
-       protected function getDatabase() {
-               return $GLOBALS['TYPO3_DB'];
-       }
-}
diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php b/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php
new file mode 100644 (file)
index 0000000..305681a
--- /dev/null
@@ -0,0 +1,290 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Tool;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Handle update wizards
+ */
+class UpgradeWizard extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initializeHandle();
+
+               // ext_localconf, db and ext_tables must be loaded for the upgrade wizards
+               $this->loadExtLocalconfDatabaseAndExtTables();
+
+               // Perform silent cache framework table upgrades
+               $this->silentCacheFrameworkTableSchemaMigration();
+
+               $actionMessages = array();
+
+               if (isset($this->postValues['set']['getUserInput'])) {
+                       $actionMessages[] = $this->getUserInputForUpgradeWizard();
+                       $this->view->assign('updateAction', 'getUserInput');
+               } elseif (isset($this->postValues['set']['performUpdate'])) {
+                       $actionMessages[] = $this->performUpdate();
+                       $this->view->assign('updateAction', 'performUpdate');
+               } else {
+                       $actionMessages[] = $this->listUpdates();
+                       $this->view->assign('updateAction', 'listUpdates');
+               }
+
+               $this->view->assign('actionMessages', $actionMessages);
+
+               return $this->view->render();
+       }
+
+       /**
+        * List of available updates
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function listUpdates() {
+               if (empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'])) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
+                       $message->setTitle('No update wizards registered');
+                       return $message;
+               }
+
+               $availableUpdates = array();
+               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
+                       $updateObject = $this->getUpgradeObjectInstance($className, $identifier);
+                       if ($updateObject->shouldRenderWizard()) {
+                               // $explanation is changed by reference in upgrade objects!
+                               $explanation = '';
+                               $updateObject->checkForUpdate($explanation);
+                               $availableUpdates[$identifier] = array(
+                                       'identifier' => $identifier,
+                                       'title' => $updateObject->getTitle(),
+                                       'explanation' => $explanation,
+                                       'renderNext' => FALSE,
+                               );
+                               // There are upgrade wizards that only show text and don't want to be executed
+                               if ($updateObject->shouldRenderNextButton()) {
+                                       $availableUpdates[$identifier]['renderNext'] = TRUE;
+                               }
+                       }
+               }
+
+               $this->view->assign('availableUpdates', $availableUpdates);
+
+               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+               $message->setTitle('Show available update wizards');
+               return $message;
+       }
+
+       /**
+        * Get user input of update wizard
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function getUserInputForUpgradeWizard() {
+               $wizardIdentifier = $this->postValues['values']['identifier'];
+
+               $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier];
+               $updateObject = $this->getUpgradeObjectInstance($className, $wizardIdentifier);
+               $wizardHtml = '';
+               if (method_exists($updateObject, 'getUserInput')) {
+                       $wizardHtml = $updateObject->getUserInput('install[values][' . $wizardIdentifier . ']');
+               }
+
+               $upgradeWizardData = array(
+                       'identifier' => $wizardIdentifier,
+                       'title' => $updateObject->getTitle(),
+                       'wizardHtml' => $wizardHtml,
+               );
+
+               $this->view->assign('upgradeWizardData', $upgradeWizardData);
+
+               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+               $message->setTitle('Show wizard options');
+               return $message;
+       }
+
+       /**
+        * Perform update of a specific wizard
+        *
+        * @throws \TYPO3\CMS\Install\Exception
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function performUpdate() {
+               $this->getDatabase()->store_lastBuiltQuery = TRUE;
+
+               $wizardIdentifier = $this->postValues['values']['identifier'];
+               $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier];
+               $updateObject = $this->getUpgradeObjectInstance($className, $wizardIdentifier);
+
+               $wizardData = array(
+                       'identifier' => $wizardIdentifier,
+                       'title' => $updateObject->getTitle(),
+               );
+
+               // $wizardInputErrorMessage is given as reference to wizard object!
+               $wizardInputErrorMessage = '';
+               if (method_exists($updateObject, 'checkUserInput') && !$updateObject->checkUserInput($wizardInputErrorMessage)) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Input parameter broken');
+                       $message->setMessage($wizardInputErrorMessage ?: 'Something went wrong!');
+                       $wizardData['wizardInputBroken'] = TRUE;
+               } else {
+                       if (!method_exists($updateObject, 'performUpdate')) {
+                               throw new \TYPO3\CMS\Install\Exception(
+                                       'No performUpdate method in update wizard with identifier ' . $wizardIdentifier,
+                                       1371035200
+                               );
+                       }
+
+                       // Both variables are used by reference in performUpdate()
+                       $customOutput = '';
+                       $databaseQueries = array();
+                       $performResult = $updateObject->performUpdate($databaseQueries, $customOutput);
+
+                       if ($performResult) {
+                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                               $message->setTitle('Update successful');
+                       } else {
+                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Update failed!');
+                               if ($customOutput) {
+                                       $message->setMessage($customOutput);
+                               }
+                       }
+
+                       if ($this->postValues['values']['showDatabaseQueries'] == 1) {
+                               $wizardData['queries'] = $databaseQueries;
+                       }
+               }
+
+               $this->view->assign('wizardData', $wizardData);
+
+               $this->getDatabase()->store_lastBuiltQuery = FALSE;
+
+               // Next update wizard, if available
+               $nextUpgradeWizard = $this->getNextUpgradeWizardInstance($updateObject);
+               $nextUpgradeWizardIdentifier = '';
+               if ($nextUpgradeWizard) {
+                       $nextUpgradeWizardIdentifier = $nextUpgradeWizard->getIdentifier();
+               }
+               $this->view->assign('nextUpgradeWizardIdentifier', $nextUpgradeWizardIdentifier);
+
+               return $message;
+       }
+
+       /**
+        * Creates instance of an upgrade object, setting the pObj, versionNumber and userInput
+        *
+        * @param string $className The class name
+        * @param string $identifier The identifier of upgrade object - needed to fetch user input
+        * @return object Newly instantiated upgrade object
+        */
+       protected function getUpgradeObjectInstance($className, $identifier) {
+               $formValues = $this->postValues;
+               $updateObject = GeneralUtility::getUserObj($className);
+               $updateObject->setIdentifier($identifier);
+               $updateObject->versionNumber = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
+               $updateObject->pObj = $this;
+               $updateObject->userInput = $formValues['values'][$identifier];
+               return $updateObject;
+       }
+
+       /**
+        * Returns the next upgrade wizard object
+        * Used to show the link/button to the next upgrade wizard
+        *
+        * @param object $currentObj Current update wizard object
+        * @return mixed Upgrade wizard instance or FALSE
+        */
+       protected function getNextUpgradeWizardInstance($currentObj) {
+               $isPreviousRecord = TRUE;
+               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
+                       // Find the current update wizard, and then start validating the next ones
+                       if ($currentObj->getIdentifier() == $identifier) {
+                               $isPreviousRecord = FALSE;
+                               continue;
+                       }
+                       if (!$isPreviousRecord) {
+                               $nextUpgradeWizard = $this->getUpgradeObjectInstance($className, $identifier);
+                               if ($nextUpgradeWizard->shouldRenderWizard()) {
+                                       return $nextUpgradeWizard;
+                               }
+                       }
+               }
+               return FALSE;
+       }
+
+       /**
+        * Force creation / update of caching framework tables that are needed by some update wizards
+        *
+        * @TODO: See also the other remarks on this topic in the abstract class, this whole area needs improvements
+        * @return void
+        */
+       protected function silentCacheFrameworkTableSchemaMigration() {
+               /** @var $sqlHandler \TYPO3\CMS\Install\Service\SqlSchemaMigrationService */
+               $sqlHandler = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
+
+               /** @var \TYPO3\CMS\Install\Service\CachingFrameworkDatabaseSchemaService $cachingFrameworkDatabaseSchemaService */
+               $cachingFrameworkDatabaseSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\CachingFrameworkDatabaseSchemaService');
+               $expectedSchemaString = $cachingFrameworkDatabaseSchemaService->getCachingFrameworkRequiredDatabaseSchema();
+               $cleanedExpectedSchemaString = implode(LF, $sqlHandler->getStatementArray($expectedSchemaString, TRUE, '^CREATE TABLE '));
+               $neededTableDefinition = $sqlHandler->getFieldDefinitions_fileContent($cleanedExpectedSchemaString);
+               $currentTableDefinition = $sqlHandler->getFieldDefinitions_database();
+               $updateTableDefinition = $sqlHandler->getDatabaseExtra($neededTableDefinition, $currentTableDefinition);
+               $updateStatements = $sqlHandler->getUpdateSuggestions($updateTableDefinition);
+               if (isset($updateStatements['create_table']) && count($updateStatements['create_table']) > 0) {
+                       $sqlHandler->performUpdateQueries($updateStatements['create_table'], $updateStatements['create_table']);
+               }
+               if (isset($updateStatements['add']) && count($updateStatements['add']) > 0) {
+                       $sqlHandler->performUpdateQueries($updateStatements['add'], $updateStatements['add']);
+               }
+               if (isset($updateStatements['change']) && count($updateStatements['change']) > 0) {
+                       $sqlHandler->performUpdateQueries($updateStatements['change'], $updateStatements['change']);
+               }
+       }
+
+       /**
+        * Overwrite getDatabase method of abstract!
+        *
+        * Returns $GLOBALS['TYPO3_DB'] directly, since this global is instantiated properly in update wizards
+        *
+        * @return \TYPO3\CMS\Core\Database\DatabaseConnection
+        */
+       protected function getDatabase() {
+               return $GLOBALS['TYPO3_DB'];
+       }
+}
index 136b9d8..c61f1b7 100644 (file)
@@ -45,7 +45,7 @@ class ToolController extends AbstractController {
                'configuration',
                'folderStructure',
                'testSetup',
-               'updateWizard',
+               'upgradeWizard',
                'allConfiguration',
                'cleanUp',
                'loadExtensions',
index 1ebb9ed..60fcc15 100644 (file)
@@ -212,12 +212,12 @@ class CompatVersionUpdate extends AbstractUpdate {
                $currentVersion = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch);
                $tableContents = '';
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['compat_version'])) {
-                       $updateWizardBoxes = '';
+                       $upgradeWizardBoxes = '';
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['compat_version'] as $internalName => $details) {
                                if ($details['version'] > $oldVersion && $details['version'] <= $currentVersion) {
                                        $description = str_replace(chr(10), '<br />', $details['description']);
                                        $description_acknowledge = isset($details['description_acknowledge']) ? str_replace(chr(10), '<br />', $details['description_acknowledge']) : '';
-                                       $updateWizardBoxes .= '
+                                       $upgradeWizardBoxes .= '
                                                <div style="border: 1px solid; padding: 10px; margin: 10px; padding-top: 0px; width: 500px;">
                                                        <h3>' . (isset($details['title']) ? $details['title'] : $internalName) . '</h3>
                                                        ' . $description . (strlen($description_acknowledge) ? '<p>' . $description_acknowledge . '</p>' : '') . (strlen($inputPrefix) ? '
@@ -234,8 +234,8 @@ class CompatVersionUpdate extends AbstractUpdate {
                                }
                        }
                }
-               if (strlen($updateWizardBoxes)) {
-                       return $updateWizardBoxes;
+               if (strlen($upgradeWizardBoxes)) {
+                       return $upgradeWizardBoxes;
                }
                return '';
        }
index 6d3ab6f..1f93b9a 100644 (file)
@@ -36,9 +36,9 @@
                                Test setup
                        </a>
                </li>
-               <li id="t3-install-menu-updateWizard" class="{f:if(condition:'{action} == \'updateWizard\'', then:'act')}">
-                       <a href="Install.php?install[action]=updateWizard&install[context]={context}&install[controller]=tool">
-                               Update wizard
+               <li id="t3-install-menu-upgradeWizard" class="{f:if(condition:'{action} == \'upgradeWizard\'', then:'act')}">
+                       <a href="Install.php?install[action]=upgradeWizard&install[context]={context}&install[controller]=tool">
+                               Upgrade Wizard
                        </a>
                </li>
                <li id="t3-install-menu-allConfiguration" class="{f:if(condition:'{action} == \'allConfiguration\'', then:'act')}">
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/GetUserInput.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/GetUserInput.html
deleted file mode 100644 (file)
index 4159f76..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <input type="hidden" name="install[values][identifier]" value="{updateWizardData.identifier}"/>
-
-       <h4>{updateWizardData.title}</h4>
-
-       <f:format.raw>{updateWizardData.wizardHtml}</f:format.raw>
-
-       <fieldset>
-               <ol>
-                       <li class="t3-install-form-label-after">
-                               <input id="t3-install-showdatabasequeries" type="checkbox" name="install[values][showDatabaseQueries]" value="1" />
-                               <label for="t3-install-showdatabasequeries">Show database queries performed</label>
-                       </li>
-               </ol>
-       </fieldset>
-
-       <f:render
-               partial="Action/Common/SubmitButton"
-               arguments="{name:'performUpdate', text:'Perform updates!'}"
-       />
-</form>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/ListUpdates.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/ListUpdates.html
deleted file mode 100644 (file)
index 23ef331..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<p>
-       If you upgrade your TYPO3 installation from one major version to another (e.g. 6.1 to 6.2),
-       then the Upgrade Wizards guide you through the necessary steps to upgrade your database
-       records or explicitly install extensions that ship with the latest TYPO3 version.
-</p>
-<hr />
-
-<f:if condition="{availableUpdates}">
-       <f:then>
-               <f:for each="{availableUpdates}" as="availableUpdate">
-                       <form method="post">
-                               <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-                               <input type="hidden" name="install[values][identifier]" value="{availableUpdate.identifier}"/>
-                               <h4>{availableUpdate.title}</h4>
-                               <f:format.raw>{availableUpdate.explanation}</f:format.raw>
-                               <f:if condition="{availableUpdate.renderNext}">
-                                       <f:render
-                                               partial="Action/Common/SubmitButton"
-                                               arguments="{name:'getUserInput', text:'Next'}"
-                                       />
-                               </f:if>
-                               <hr />
-                       </form>
-               </f:for>
-       </f:then>
-       <f:else>
-               <p>
-                       <strong>No updates to perform!</strong>
-               </p>
-               <hr />
-       </f:else>
-</f:if>
-
-<h4>Final step</h4>
-<p>
-       When all updates are done you should check your database for required updates.
-       <br />
-       Perform the database analyzer steps until no more changes are required.
-</p>
-<a href="Install.php?install[action]=importantActions&install[context]={context}&install[controller]=tool">
-       Go to database analyzer
-</a>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/PerformUpdate.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/PerformUpdate.html
deleted file mode 100644 (file)
index 11aa99f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<p class="innerWidth">
-       <strong>{wizardData.title}</strong>
-</p>
-
-<f:if condition="{wizardData.wizardInputBroken}">
-       <f:then>
-               <a href="javascript:history.back()">
-                       Go back to update configuration
-               </a>
-       </f:then>
-
-       <f:else>
-               <f:if condition="{wizardData.queries}">
-                       <f:for each="{wizardData.queries}" as="query">
-                               {query}
-                               <br />
-                       </f:for>
-               </f:if>
-       </f:else>
-</f:if>
-
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <f:if condition="{nextUpdateWizardIdentifier}">
-               <f:then>
-                       <input type="hidden" name="install[values][identifier]" value="{nextUpdateWizardIdentifier}"/>
-                       <f:render
-                               partial="Action/Common/SubmitButton"
-                               arguments="{name:'getUserInput', text:'Go to the next update wizard'}"
-                       />
-               </f:then>
-               <f:else>
-                       <f:render
-                               partial="Action/Common/SubmitButton"
-                               arguments="{name:'backToWizard', text:'Go back to the update wizard'}"
-                       />
-               </f:else>
-       </f:if>
-       <hr />
-</form>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/GetUserInput.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/GetUserInput.html
new file mode 100644 (file)
index 0000000..fbbf801
--- /dev/null
@@ -0,0 +1,22 @@
+<form method="post">
+       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
+       <input type="hidden" name="install[values][identifier]" value="{upgradeWizardData.identifier}"/>
+
+       <h4>{upgradeWizardData.title}</h4>
+
+       <f:format.raw>{upgradeWizardData.wizardHtml}</f:format.raw>
+
+       <fieldset>
+               <ol>
+                       <li class="t3-install-form-label-after">
+                               <input id="t3-install-showdatabasequeries" type="checkbox" name="install[values][showDatabaseQueries]" value="1" />
+                               <label for="t3-install-showdatabasequeries">Show database queries performed</label>
+                       </li>
+               </ol>
+       </fieldset>
+
+       <f:render
+               partial="Action/Common/SubmitButton"
+               arguments="{name:'performUpdate', text:'Perform updates!'}"
+       />
+</form>
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..23ef331
--- /dev/null
@@ -0,0 +1,42 @@
+<p>
+       If you upgrade your TYPO3 installation from one major version to another (e.g. 6.1 to 6.2),
+       then the Upgrade Wizards guide you through the necessary steps to upgrade your database
+       records or explicitly install extensions that ship with the latest TYPO3 version.
+</p>
+<hr />
+
+<f:if condition="{availableUpdates}">
+       <f:then>
+               <f:for each="{availableUpdates}" as="availableUpdate">
+                       <form method="post">
+                               <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
+                               <input type="hidden" name="install[values][identifier]" value="{availableUpdate.identifier}"/>
+                               <h4>{availableUpdate.title}</h4>
+                               <f:format.raw>{availableUpdate.explanation}</f:format.raw>
+                               <f:if condition="{availableUpdate.renderNext}">
+                                       <f:render
+                                               partial="Action/Common/SubmitButton"
+                                               arguments="{name:'getUserInput', text:'Next'}"
+                                       />
+                               </f:if>
+                               <hr />
+                       </form>
+               </f:for>
+       </f:then>
+       <f:else>
+               <p>
+                       <strong>No updates to perform!</strong>
+               </p>
+               <hr />
+       </f:else>
+</f:if>
+
+<h4>Final step</h4>
+<p>
+       When all updates are done you should check your database for required updates.
+       <br />
+       Perform the database analyzer steps until no more changes are required.
+</p>
+<a href="Install.php?install[action]=importantActions&install[context]={context}&install[controller]=tool">
+       Go to database analyzer
+</a>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/PerformUpdate.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpgradeWizard/PerformUpdate.html
new file mode 100644 (file)
index 0000000..c9eb11c
--- /dev/null
@@ -0,0 +1,40 @@
+<p class="innerWidth">
+       <strong>{wizardData.title}</strong>
+</p>
+
+<f:if condition="{wizardData.wizardInputBroken}">
+       <f:then>
+               <a href="javascript:history.back()">
+                       Go back to update configuration
+               </a>
+       </f:then>
+
+       <f:else>
+               <f:if condition="{wizardData.queries}">
+                       <f:for each="{wizardData.queries}" as="query">
+                               {query}
+                               <br />
+                       </f:for>
+               </f:if>
+       </f:else>
+</f:if>
+
+<form method="post">
+       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
+       <f:if condition="{nextUpgradeWizardIdentifier}">
+               <f:then>
+                       <input type="hidden" name="install[values][identifier]" value="{nextUpgradeWizardIdentifier}"/>
+                       <f:render
+                               partial="Action/Common/SubmitButton"
+                               arguments="{name:'getUserInput', text:'Go to the next update wizard'}"
+                       />
+               </f:then>
+               <f:else>
+                       <f:render
+                               partial="Action/Common/SubmitButton"
+                               arguments="{name:'backToWizard', text:'Go back to the update wizard'}"
+                       />
+               </f:else>
+       </f:if>
+       <hr />
+</form>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpdateWizard.html b/typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpdateWizard.html
deleted file mode 100644 (file)
index 53f9ebb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{namespace i=TYPO3\CMS\Install\ViewHelpers}
-
-<f:layout name="ToolAuthenticated" />
-
-<f:section name="Content">
-       <h3>Update wizard</h3>
-
-       <f:for each="{actionMessages}" as="statusMessage">
-               <f:render partial="Action/Common/StatusMessage" arguments="{message: statusMessage}" />
-       </f:for>
-
-
-       <f:if condition="{updateAction} == 'listUpdates'">
-               <f:render partial="Action/Tool/UpdateWizard/ListUpdates" arguments="{_all}" />
-       </f:if>
-
-       <f:if condition="{updateAction} == 'getUserInput'">
-               <f:render partial="Action/Tool/UpdateWizard/GetUserInput" arguments="{_all}" />
-       </f:if>
-
-       <f:if condition="{updateAction} == 'performUpdate'">
-               <f:render partial="Action/Tool/UpdateWizard/PerformUpdate" arguments="{_all}" />
-       </f:if>
-
-</f:section>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpgradeWizard.html b/typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpgradeWizard.html
new file mode 100644 (file)
index 0000000..21a3679
--- /dev/null
@@ -0,0 +1,25 @@
+{namespace i=TYPO3\CMS\Install\ViewHelpers}
+
+<f:layout name="ToolAuthenticated" />
+
+<f:section name="Content">
+       <h3>Upgrade Wizard</h3>
+
+       <f:for each="{actionMessages}" as="statusMessage">
+               <f:render partial="Action/Common/StatusMessage" arguments="{message: statusMessage}" />
+       </f:for>
+
+
+       <f:if condition="{updateAction} == 'listUpdates'">
+               <f:render partial="Action/Tool/UpgradeWizard/ListUpdates" arguments="{_all}" />
+       </f:if>
+
+       <f:if condition="{updateAction} == 'getUserInput'">
+               <f:render partial="Action/Tool/UpgradeWizard/GetUserInput" arguments="{_all}" />
+       </f:if>
+
+       <f:if condition="{updateAction} == 'performUpdate'">
+               <f:render partial="Action/Tool/UpgradeWizard/PerformUpdate" arguments="{_all}" />
+       </f:if>
+
+</f:section>
\ No newline at end of file
index e109bdf..71969fc 100644 (file)
                </ul>
        </p>
        <p>
-               <strong>6: Update wizard</strong>
+               <strong>6: Upgrade Wizard</strong>
                <br />
                If you upgrade your TYPO3 CMS installation from one version to another (e.g. 6.1 to 6.2),
                then the Upgrade Wizards guide you through the necessary steps to upgrade your database records
diff --git a/typo3/sysext/install/Resources/Public/Images/Menu/UpdateWizard.png b/typo3/sysext/install/Resources/Public/Images/Menu/UpdateWizard.png
deleted file mode 100644 (file)
index 5b8cfda..0000000
Binary files a/typo3/sysext/install/Resources/Public/Images/Menu/UpdateWizard.png and /dev/null differ
diff --git a/typo3/sysext/install/Resources/Public/Images/Menu/UpgradeWizard.png b/typo3/sysext/install/Resources/Public/Images/Menu/UpgradeWizard.png
new file mode 100644 (file)
index 0000000..5b8cfda
Binary files /dev/null and b/typo3/sysext/install/Resources/Public/Images/Menu/UpgradeWizard.png differ
index 6232eaa..c10bdfa 100644 (file)
@@ -364,8 +364,8 @@ button span.t3-install-form-button-icon-negative {
        background-image: url('../../../Images/Menu/FolderStructure.png');
 }
 
-#t3-install-menu #t3-install-menu-updateWizard {
-       background-image: url('../../../Images/Menu/UpdateWizard.png');
+#t3-install-menu #t3-install-menu-upgradeWizard {
+       background-image: url('../../../Images/Menu/UpgradeWizard.png');
 }
 
 #t3-install-menu #t3-install-menu-testSetup {