AfterFormDefinitionValidationConfigurationIsBuiltEvent 

New in version 15.0 Feature: #109849 - PSR-14 Event after form definition validation config is built

The event replaces the removed hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['buildFormDefinitionValidationConfiguration'] .

The event \TYPO3\CMS\Form\Event\AfterFormDefinitionValidationConfigurationIsBuiltEvent is dispatched after the validation configuration of the form editor has been built for a prototype. The form editor only saves the properties that this configuration allows. A listener can add property paths for a custom inspector editor that does not declare its paths in the YAML configuration, for example with propertyPath.

Example: Allow the form editor to save a custom property 

The following listener allows the form editor to save the property properties.my.custom.property of the custom form element MyCustomElement. A custom inspector editor sets this property without a propertyPath in the YAML configuration:

EXT:my_extension/Classes/EventListener/CustomPropertyPathListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

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

final readonly class CustomPropertyPathListener
{
  #[AsEventListener(
    identifier: 'my-extension/custom-property-path',
  )]
  public function __invoke(Event $event): void
  {
    $configuration = $event->getConfiguration();
    $element = $configuration['formElements']['MyCustomElement'] ?? [];
    // Allow the form editor to write a property that a custom
    // inspector editor sets without a "propertyPath"
    $element['additionalPropertyPaths'][] = 'properties.my.custom.property';
    $configuration['formElements']['MyCustomElement'] = $element;
    $event->setConfiguration($configuration);
  }
}
Copied!

API 

final class AfterFormDefinitionValidationConfigurationIsBuiltEvent
Fully qualified name
\TYPO3\CMS\Form\Event\AfterFormDefinitionValidationConfigurationIsBuiltEvent

Listeners to this event are able to modify the form definition validation configuration after it has been built from the form editor setup. Use this event to add additional writable property paths for custom form editor inspector editor implementations that do not declare their writable property paths through the standard YAML configuration (e.g. propertyPath).

getPrototypeName()
Returns
string
getConfiguration()
Returns
array
setConfiguration(array $configuration)
param $configuration

the configuration