Issue Bug Closed

#104421SiteConfigurationLoadedEvent not fired in "form engine" context.

Lars Peter Søndergaard 07/18/24, 10:16 updated 07/23/24, 18:47

Description

When opening the site config for editing there is a situation where the SiteConfigurationLoadedEvent is not fired.

Specifically, the \TYPO3\CMS\Backend\Form\FormDataProvider\SiteDatabaseEditRow uses \TYPO3\CMS\Core\Configuration\SiteConfiguration::load which loads the yaml file without the chance of processing it.

To explain my situation:

I tried to make the “settings” array in a site config editable from the site backend module.

For that my plan was to convert the nested ["settings"]["foo"]["bar"] into a flat version ["settings.foo.bar"] (and the reverse for storing, using SiteConfigurationBeforeWriteEvent – which works fine), and then simply use SiteConfiguation/Overrides with those flattened column names.

This works mostly, but the one place where it’s actually needed, is when the form data provider uses the configuration to populate the databaseRow array for prefilling the stored values in the form fields.

I currently solved it by adding a custom form data provider right after the mentioned one above, and everything works as envisioned. But it would be nicer if I could use an event instead. If not the SiteConfigurationLoadedEvent, then maybe a separate one for similar intent.

Greetings

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.