[BUGFIX] Fix bad preconditions for PackageStates migration 93/24793/2
authorThomas Maroschik <tmaroschik@dfau.de>
Tue, 15 Oct 2013 12:49:13 +0000 (14:49 +0200)
committerThomas Maroschik <tmaroschik@dfau.de>
Tue, 15 Oct 2013 13:06:28 +0000 (15:06 +0200)
The PackageStates.php file migration from LocalConfiguration.php happens
transparently upon the first call of the install tool. If the file
LocalConfiguration.php is not available yet, like during installation
from a blank package this step fails.

This patch introduces some more checks that check if typo3conf and
LocalConfiguration.php are present before the migration of PackageStates
kicks in.

Resolves: #52847
Releases: 6.2
Change-Id: I5dede4123ad1474c0493c85d96350fd6cfdc04c4
Reviewed-on: https://review.typo3.org/24793
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
typo3/sysext/install/Classes/Controller/StepController.php

index 4d944bf..e2b9cfa 100644 (file)
@@ -267,7 +267,11 @@ class StepController extends AbstractController {
         */
        protected function migrateExtensionListToPackageStatesFile() {
                try {
-                       if (file_exists(PATH_typo3conf . 'PackageStates.php')) {
+                       /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+                       $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                       $localConfigurationFileLocation = $configurationManager->getLocalConfigurationFileLocation();
+                       $localConfigurationFileExists = is_file($localConfigurationFileLocation);
+                       if (!is_dir(PATH_typo3conf) || (is_dir(PATH_typo3conf) && !$localConfigurationFileExists) || file_exists(PATH_typo3conf . 'PackageStates.php')) {
                                return;
                        }
                        $bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();