BeforeFormIsDuplicatedEvent 

New in version 14.0

The event BeforeFormIsDuplicatedEvent is a replacement for the removed hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/form']['beforeFormDuplicate'] .

The BeforeFormIsDuplicatedEvent event is dispatched just before a new form is duplicated in the backend.

Example 

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

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

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

#[AsEventListener(
    identifier: 'my-extension/before-form-is-duplicated',
)]
final readonly class MyEventListener
{
    public function __invoke(BeforeFormIsDuplicatedEvent $event): void
    {
        $event->form['label'] = 'foo';
    }
}
Copied!

API 

class BeforeFormIsDuplicatedEvent
Fully qualified name
\TYPO3\CMS\Form\Event\BeforeFormIsDuplicatedEvent

Listeners to this Event will be able to modify the form definition and persistence identifier before a form is duplicated.

public formPersistenceIdentifier
public form