Feature: #98521 - PSR-14 event to modify form data for edit file form

See forge#98521


A new PSR-14 event TYPO3\CMS\Filelist\Event\ModifyEditFileFormDataEvent has been added, which allows to modify the form data used to render the file edit form in the File > Filelist module using FormEngine data compiling.

The new event can be used as an improved alternative for the removed $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'] hook.

The event features the following methods:

  • getFormData(): Returns the current $formData array
  • setFormData(): Sets the $formData array
  • getFile(): Returns the corresponding \TYPO3\CMS\Core\Resource\FileInterface
  • getRequest(): Returns the full PSR-7 \Psr\Http\Message\ServerRequestInterface

Registration of the event in your extension's Services.yaml:

    - name: event.listener
      identifier: 'my-package/modify-edit-file-form-data-event-listener'

The corresponding event listener class:

use TYPO3\CMS\Filelist\Event\ModifyEditFileFormDataEvent;

final class ModifyEditFileFormDataEventListener
    public function __invoke(ModifyEditFileFormDataEvent $event): void
        // Get current form data
        $formData = $event->getFormData();

        // Change TCA "renderType" based on the file extension
        $fileExtension = $event->getFile()->getExtension();
        if ($fileExtension === 'ts') {
            $formData['processedTca']['columns']['data']['config']['renderType'] = 'tsRenderer';

        // Set updated form data


It is now possible to modify the whole $formData array used to generate the edit file form in the File > Filelist module, while having the resolved FileInterface and the current PSR-7 ServerRequestInterface available.