Breaking: #109811 - Removed "afterFormStateInitialized" hook
See forge#109811
Description
The hook
$GLOBALS
has been removed in favor of the PSR-14 event
\TYPO3\.
In addition, the interface
\TYPO3\
has been removed as it was only used by the hook.
Impact
Hook implementations registered under
after are
no longer executed in TYPO3 v15.0 and later.
Classes implementing
\TYPO3\
will cause a PHP fatal error.
Affected installations
TYPO3 installations with custom extensions using this hook or implementing
After are affected.
The extension scanner reports any usage as a strong match.
Migration
Register a PSR-14 event listener for
\TYPO3\ instead:
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Form\Event\AfterFormStateInitializedEvent;
#[AsEventListener(identifier: 'my-extension/after-form-state-initialized')]
final readonly class MyAfterFormStateInitializedEventListener
{
public function __invoke(AfterFormStateInitializedEvent $event): void
{
// Access $event->formRuntime->getFormState() here
}
}
Remove the hook registration from ext_ and the
After implementation from your hook class.
See also the Feature entry.