[BUGFIX] Install tool upgrade wizards fail on postgres 62/51862/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 26 Feb 2017 16:15:02 +0000 (17:15 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 26 Feb 2017 17:36:03 +0000 (18:36 +0100)
Controller class UpgradeWizard of install tool method performUpdate()
calls getDatabaseConnection() (old TYPO3_DB) and connects. This was
done in the past to receive the list of executed queries during
upgrade and is now implemented in the single upgrade classes directly.

If running postgres, the connect attempt of old database class tries
to connect to a mysql instance and runs into a timeout.

Remove this TYPO3_DB left over from the install tool to successfully
execute upgrade wizards on non-mysql platforms.

Change-Id: Ia87ae4bce1c4f4992527f0fa6fbddebdb6e3733c
Resolves: #80026
Releases: master
Reviewed-on: https://review.typo3.org/51862
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php

index 5b69dcb..2e75b8b 100644 (file)
@@ -187,30 +187,6 @@ abstract class AbstractAction implements ActionInterface
     }
 
     /**
-     * Get database instance.
-     * Will be initialized if it does not exist yet.
-     *
-     * @return \TYPO3\CMS\Core\Database\DatabaseConnection
-     */
-    protected function getDatabaseConnection()
-    {
-        static $database;
-        if (!is_object($database)) {
-            /** @var \TYPO3\CMS\Core\Database\DatabaseConnection $database */
-            $database = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
-            $database->setDatabaseUsername($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user']);
-            $database->setDatabasePassword($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password']);
-            $database->setDatabaseHost($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host']);
-            $database->setDatabasePort($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['port']);
-            $database->setDatabaseSocket($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['unix_socket']);
-            $database->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']);
-            $database->initialize();
-            $database->connectDB();
-        }
-        return $database;
-    }
-
-    /**
      * Some actions like the database analyzer and the upgrade wizards need additional
      * bootstrap actions performed.
      *
index 05b0f1a..fc8fd6c 100644 (file)
@@ -284,8 +284,6 @@ class UpgradeWizard extends Action\AbstractAction
      */
     protected function performUpdate()
     {
-        $this->getDatabaseConnection()->store_lastBuiltQuery = true;
-
         $wizardIdentifier = $this->postValues['values']['identifier'];
         $className = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'][$wizardIdentifier];
         $updateObject = $this->getUpdateObjectInstance($className, $wizardIdentifier);
@@ -336,8 +334,6 @@ class UpgradeWizard extends Action\AbstractAction
 
         $this->view->assign('wizardData', $wizardData);
 
-        $this->getDatabaseConnection()->store_lastBuiltQuery = false;
-
         // Next update wizard, if available
         $nextUpdate = $this->getNextUpdateInstance($updateObject);
         $nextUpdateIdentifier = '';