Deprecation: #94317 - ext:form Finisher implementations

See forge#94317

Description

In preparation of the Extbase ObjectManager deprecation in favor of symfony dependency injection, some details of EXT:form finishers had to be adapted: In contrast to Extbase object management, symfony DI does not support prototype classes with a mixture of manual constructor arguments, plus dependency injection via other constructor arguments or inject methods.

The EXT:form finishers based on \TYPO3\CMS\Form\Domain\Finishers\FinisherInterface relied on this and had to be adapted: The default constructor argument $finisherIdentifier has been dropped, so finisher implementations can keep using dependency injection.

Impact

A compatibility layer detects non-adapted finishers and falls back to initialization using Extbase ObjectManager. This will will trigger a PHP E_USER_DEPRECATED error.

Affected Installations

In general only instances with custom form based on EXT:form are affected, and only if they implement custom finishers.

Most custom finishers probably extend \TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher . Those are only affected if they override __construct() or use or manipulate properties $finisherIdentifier or $shortFinisherIdentifier in inject*() or injectObject() methods. This is rather unlikely.

Custom finishers that do not extend \TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher are affected.

Migration

Custom finishers should extend \TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher .

If they must implement __construct(), they should not expect $finisherIdentifier to be hand over as first argument and must not call parent::construct() anymore.

Custom finishers must not rely on $finisherIdentifier or $shortFinisherIdentifier being set in early methods like __construct(), inject*() and injectObject(), and must not set these properties.

Custom finishers must implement method setFinisherIdentifier(), this method will be added to \TYPO3\CMS\Form\Domain\Finishers\FinisherInterface in TYPO3 v12.

Custom finishers must not use class property $objectManager since this will vanish in v12. This will affect more API cases and will have a dedicated deprecation file with more details, though.