[BUGFIX] Update LocalConfiguration fails
authorNicole Cordes <n.cordes@biz-design.biz>
Wed, 31 Oct 2012 20:53:15 +0000 (21:53 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 2 Nov 2012 20:18:03 +0000 (21:18 +0100)
Due to changes in function
TYPO3\CMS\Core\Configuration\ConfigurationManager::writeLocalConfiguration
an error is thrown when the configuration file isn't accessable.

Of course when updating the system from a lower version it is not
available. So the installation process has to create the file on its own
to be able to write the settings.

Change-Id: I89553390ebd9f1f576311535e02ec73da6618cd6
Fixes: #42271
Releases: 6.0
Reviewed-on: http://review.typo3.org/16088
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/install/Classes/CoreUpdates/LocalConfigurationUpdate.php

index abd8888..30ca06b 100644 (file)
@@ -108,6 +108,11 @@ class LocalConfigurationUpdate extends \TYPO3\CMS\Install\Updates\AbstractUpdate
                        // Add db settings to array
                        $TYPO3_CONF_VARS['DB'] = $typo3DatabaseVariables;
                        $TYPO3_CONF_VARS = \TYPO3\CMS\Core\Utility\ArrayUtility::sortByKeyRecursive($TYPO3_CONF_VARS);
+                       // Build new (empty) LocalConfiguration file if not exists as the function writeLocalConfiguration depends on it
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->getLocalConfigurationFileResource(),
+                               ''
+                       );
                        // Write out new LocalConfiguration file
                        \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->writeLocalConfiguration($TYPO3_CONF_VARS);
                        // Write out new AdditionalConfiguration file