Skip to content
Snippets Groups Projects
Commit 962042ce authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[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: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 5527b0d1
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment