[BUGFIX] Install tool throws database errors in upgrade wizard
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / mod / class.tx_install.php
index 3784a32..16b6f27 100644 (file)
@@ -5569,7 +5569,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                        if ($tblFileContent) {
                                                $fileContent = implode(
                                                        LF,
-                                                       $this->getStatementArray($tblFileContent,1,'^CREATE TABLE ')
+                                                       $this->sqlHandler->getStatementArray($tblFileContent,1,'^CREATE TABLE ')
                                                );
                                                $FDfile = $this->sqlHandler->getFieldDefinitions_fileContent($fileContent);
                                                if (!count($FDfile)) {
@@ -6345,6 +6345,22 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        // clear cache files
                t3lib_extMgm::removeCacheFiles(t3lib_extMgm::getCacheFilePrefix());
 
+                       // Forces creation / update of caching framework tables that are needed by some update wizards
+               $cacheTablesConfiguration = implode(LF, $this->sqlHandler->getStatementArray(t3lib_cache::getDatabaseTableDefinitions(), 1, '^CREATE TABLE '));
+               $neededTableDefinition = $this->sqlHandler->getFieldDefinitions_fileContent($cacheTablesConfiguration);
+               $currentTableDefinition = $this->sqlHandler->getFieldDefinitions_database();
+               $updateTableDefenition = $this->sqlHandler->getDatabaseExtra($neededTableDefinition, $currentTableDefinition);
+               $updateStatements = $this->sqlHandler->getUpdateSuggestions($updateTableDefenition);
+               if (isset($updateStatements['create_table']) && count($updateStatements['create_table']) > 0) {
+                       $this->sqlHandler->performUpdateQueries($updateStatements['create_table'], $updateStatements['create_table']);
+               }
+               if (isset($updateStatements['add']) && count($updateStatements['add']) > 0) {
+                       $this->sqlHandler->performUpdateQueries($updateStatements['add'], $updateStatements['add']);
+               }
+               if (isset($updateStatements['change']) && count($updateStatements['change']) > 0) {
+                       $this->sqlHandler->performUpdateQueries($updateStatements['change'], $updateStatements['change']);
+               }
+
                        // call wizard
                $action = ($this->INSTALL['database_type'] ? $this->INSTALL['database_type'] : 'checkForUpdate');
                $this->updateWizard_parts($action);
@@ -8368,4 +8384,4 @@ $out="
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/install/mod/class.tx_install.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/install/mod/class.tx_install.php']);
 }
-?>
+?>
\ No newline at end of file