78185[BUGFIX] Ensure deprecated settings in `config.yaml` are not changed
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Benni Mack +1
-
Verified V +2 Done
- Stefan Bürk +2
- Benni Mack +1
- core-ci +1 CI
Issues 2
Files 4
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php2+38 −34
- typo3/sysext/core/Classes/Configuration/SiteConfiguration.php+25 −0
- typo3/sysext/core/Documentation/Changelog/12.1/Feature-99047-LoadSiteSettingsFromSeparateSettingsyaml.rst+9 −1
- typo3/sysext/core/Documentation/Changelog/12.1/Feature-99221-AddCliInstallSetupCommand.rst+1 −1
Review log 2228
Show 23 earlier messages
-
Georg Ringer uploaded patch set 1 03/20/23, 19:39
-
Georg Ringer commented on patch set 1 03/20/23, 19:39
This change is ready for review. -
core-ci voted on patch set 1 V +1 03/20/23, 19:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39272
-
Markus Klein commented on patch set 1 03/20/23, 20:03
it "feels wrong" somehow. This unmotivated `unset()` out of nowhere with no explanation, why this is done. Not sure if some other place is writing site configuration, but this safeguard should be placed everywhere then.SiteConfigurationController.php:393should this maybe happen somewhere here or even within one of these methods? -
Stefan Bürk updated the commit message in patch set 2
V +103/23/23, 00:45 -
core-ci voted on patch set 2 V +1 03/23/23, 00:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39430
-
Stefan Bürk commented on patch set 2 CR -1 03/23/23, 00:57
Reply
Simpy using `unset()` is not a good approach here. With #99047 site `settings.yaml` has been introduced along with an upgrade wizard. On loading it checks, if that file exists and otherwise falling back to "config.yml" settings subarray. So, unset should only be done if for the site a "settings.yaml" exists. Otherwise, settings may be lost **before** upgrade wizard may have been executed on upgrade scenarios. However, not sure if this should be eventually handled in siteConfig->write() with unsetting there if file exists. And it should be more documented that this is a one time extraction, so having it guarded in siteconfig write() would be the better place: E.g. here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76491/26/typo3/sysext/core/Classes/Configuration/SiteConfiguration.php#267 ``` $fileName = $this->configPath . '/' . $siteIdentifier . '/' . $this->settingsFileName; if (file_exists($fileName)) { // site has a dedicated settings file, which means upgrade // wizard has been run. Therefore, no longer write settings // in site config file. unset($siteConfiguration['settings'); } ``` Thus -1 due risking settings before migration with current approach. -
Benni Mack updated the commit message in patch set 3
CR -1V +105/03/23, 09:55 -
Benni Mack commented on patch set 3 07/05/23, 13:51
how to continue here? -
Stefan Bürk commented on patch set 3 07/07/23, 10:54
Reply
Unsetting it here is not the right way. Currently, settings are only `copied` to the `settings.yaml` by the UpgradeWizard introduced with 99047, starting to load and use only settings from that file. Because it's loaded from the other file, it will currently written to the `config.yaml` - which is wrong and should not be done anymore (albeit keeping current or manually added settings in the `config.yaml` file. The (intermediate) solution must be to load the siteconfiguration only from the `config.yaml` and ignore the `settings.yaml` in the save action, so changed, removed or updated settings are not updated in the `config.yaml`. Additionally, we should add a small addition to the corresponding changelog. The plan is to add a dedicated GUI for the settings, which currently do not have an GUI counterpart. Will push a corresponding change set.SiteConfigurationController.php:393ReplyAt the moment a unset and therefore removing the settings from the `config.yaml` is not the way to go. Should be kept and resolved manually, as they have no effect anymore. -
Stefan Bürk uploaded patch set 4 07/07/23, 11:00
-
Stefan Bürk commented on patch set 4 07/07/23, 11:01
Reply
Done -
core-ci voted on patch set 4 V +1 07/07/23, 11:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43888
-
Benni Mack updated the commit message in patch set 5
V +107/07/23, 11:30 -
core-ci voted on patch set 5 V +1 07/07/23, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43894
-
Stefan Bürk voted on patch set 5 V +1 CR +1 07/07/23, 12:25
-
Benni Mack commented on patch set 5 07/07/23, 13:04
SiteFinder.php:79this will be a bad idea. $this->sites might be now a associated array with identifiers, where as it is expected to be Site[] -
Stefan Bürk commented on patch set 5 07/08/23, 05:57
SiteFinder.php:79ReplyI would disagree here. The `string => string` rework is stored inanother property. `$this->sites` is iterated, the rewrok saved in `$this->mappingRootPageIdToIdentifier` ... and `$this->sites` ( `Sites[]` ) returned untouched. These 5 lines are basically a clone of `SiteFinder->fetchAllSites()` at the end of the file. I just decided to let that intermediate method out for the internal chain here. The difference is, that it calls another method on the `SiteConfiguration` class then the other method to avoid `loading` the `settings.yaml` even if it exists. We need to set these arres here so in-context requests gets the cached variants of the stripped down sites. This is not bad, this is intended. In the `SiteConfigruationController->ditAction()` all sites have been loaded with `useCache = false` to ensure current loaded state, filling internal state in finder and siteconfiguration (properties) - so that the later FormEngine calls, which eventually needs SiteConfigurations can operate on this "pre-loaded but process wise internal cached aka request cache". We need this, but with the "omitted" `settings.yaml` in this call chain. Therefore, I added a second (internal) path to the place where we need to change that behaviour and only load `config.yaml` without `settings.yaml`. Other solution would be to add a second argument to all methods in that chaing, but that one would only make sense for useCache = false and mybe would be missused by outside world - and this should not bekome API, which the current methods are - so I discarded that option. Would you still say it's a bad idea or does this make some sense for you, Benni ? -
Stefan Bürk rebased onto patch set 6
CR +1V +107/12/23, 23:23 -
core-ci voted on patch set 6 V +1 07/12/23, 23:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44101
-
Stefan Bürk voted on patch set 6 CR -1 07/13/23, 06:19
-
Stefan Bürk uploaded patch set 7
CR -1V +107/13/23, 08:33 -
core-ci voted on patch set 7 V +1 07/13/23, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44113
-
Stefan Bürk commented on patch set 7 07/13/23, 08:46
SiteFinder.php:79ReplyResolving this comment as code is not included anymore. -
Stefan Bürk voted on patch set 7 V +1 CR +1 07/13/23, 13:08
-
Benni Mack voted on patch set 7 V +1 CR +1 07/13/23, 18:39
-
Stefan Bürk voted on patch set 7 V +2 CR +2 07/14/23, 06:14
-
Stefan Bürk merged patch set 8 07/14/23, 06:15