[BUGFIX] Allow to edit legacy site configuration files in BE 49/58449/2
authorBenni Mack <benni@typo3.org>
Sat, 29 Sep 2018 10:07:45 +0000 (12:07 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 29 Sep 2018 10:22:50 +0000 (12:22 +0200)
We recently removed the "site" base prefix within the yaml
configuration file of a site configuration.

However, the indention is wrong when using FormEngine
to edit the site configuration within the "old" syntax.

Resolves: #86437
Related: #86323
Releases: master
Change-Id: I487940188b04c4977d179337cb142f2452c3bace
Reviewed-on: https://review.typo3.org/58449
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/SiteDatabaseEditRow.php

index 6f12603..96ea8a2 100644 (file)
@@ -85,6 +85,14 @@ class SiteDatabaseEditRow implements FormDataProviderInterface
             Environment::getConfigPath() . '/sites'
         );
         // load config as it is stored on disk (without replacements)
-        return $siteConfiguration->load($site->getIdentifier());
+        $configuration = $siteConfiguration->load($site->getIdentifier());
+        if (isset($configuration['site'])) {
+            trigger_error(
+                'Site configuration with key \'site\' has been deprecated, remove indentation level and site key.',
+                E_USER_DEPRECATED
+            );
+            $configuration = $configuration['site'];
+        }
+        return $configuration;
     }
 }