[TASK] Avoid ObjectManager around ext:form FormDefinition
One of the main classes. symfony DI does not support having a combination of constructor arguments plus autowired dependencies. This needs to be resolved for systems around FormDefinition: * FormDefinition itself looses its inject* method for ObjectManager. It's a class not meant to be sub classed by 3rd party extensions. The constructor arguments can be kept, FormDefinition is now instantiated using makeInstance(). * Domain/Model/FormElements/Page and classes extending this class and registering them using implementationClassName for a form must not rely on inject* and initializeObject methods since they need manual constructor arguments. A b/w compat layer detects this and falls back to ObjectManager, even though Page is marked as NOT to be extended by developers. * FormRuntime looses its inject* and initializeObject methods and is instantiated using makeInstance() keeping existing constructor arguments. The class is hardcoded and API does not consider overwriting, so no fallback layer. * Finishers are a bit more tricky: They are often extended in projects, reliable b/w compat is needed. They have one constructor argument and rely on injection. It's useful to keep the injection, so the constructor argument is dropped and substituted with a setter called after initializations. A compat layer detects not adapted classes and falls back to ObjectManager. Resolves: #94317 Related: #90803 Releases: master Change-Id: If157457a6bab568e1f8c32a6f09e60dba0b595f4 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69462 Tested-by:core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de>
Showing
- typo3/sysext/core/Documentation/Changelog/master/Deprecation-94317-ExtformFinisherImplementations.rst 66 additions, 0 deletions...ster/Deprecation-94317-ExtformFinisherImplementations.rst
- typo3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php 1 addition, 2 deletions...3/sysext/form/Classes/Domain/Factory/ArrayFormFactory.php
- typo3/sysext/form/Classes/Domain/Finishers/AbstractFinisher.php 17 additions, 6 deletions...sysext/form/Classes/Domain/Finishers/AbstractFinisher.php
- typo3/sysext/form/Classes/Domain/Finishers/FinisherInterface.php 6 additions, 0 deletions...ysext/form/Classes/Domain/Finishers/FinisherInterface.php
- typo3/sysext/form/Classes/Domain/Model/FormDefinition.php 48 additions, 25 deletionstypo3/sysext/form/Classes/Domain/Model/FormDefinition.php
- typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php 11 additions, 62 deletionstypo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
Please register or sign in to comment