Feature: #109849 - PSR-14 Event after form definition validation config built 

See forge#109849

Description 

A new PSR-14 event \TYPO3\CMS\Form\Event\AfterFormDefinitionValidationConfigurationIsBuiltEvent has been introduced as a replacement for the now removed hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['buildFormDefinitionValidationConfiguration'] .

The event is dispatched by \TYPO3\CMS\Form\Domain\Configuration\ConfigurationService after the form definition validation configuration has been built from the form editor setup. It allows event listeners to add additional writable property paths for custom form editor inspector editor implementations that do not declare their writable property paths via the standard YAML configuration (e.g. propertyPath ).

The event provides the following API:

  • getPrototypeName(): string – The prototype name for which the configuration was built.
  • getConfiguration(): array – The built validation configuration.
  • setConfiguration(array $configuration): void – Replace the validation configuration.

Example 

An example event listener that adds an additional writable property path for a custom form element type:

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Form\Event\AfterFormDefinitionValidationConfigurationIsBuiltEvent;

#[AsEventListener(
    identifier: 'my-extension/after-form-definition-validation-configuration-is-built',
)]
final readonly class MyEventListener
{
    public function __invoke(AfterFormDefinitionValidationConfigurationIsBuiltEvent $event): void
    {
        $configuration = $event->getConfiguration();
        $configuration['formElements']['MyCustomElement']['additionalPropertyPaths'][]
            = 'properties.my.custom.property';
        $event->setConfiguration($configuration);
    }
}
Copied!

Impact 

With the new AfterFormDefinitionValidationConfigurationIsBuiltEvent , it is now possible to extend the form definition validation configuration using the modern PSR-14 event listener API.