Review main Merged

69462[TASK] Avoid ObjectManager around ext:form FormDefinition

Christian Kuhn CR +2 V +2 Normal +149 −95 updated 06/12/21, 20:59

Commit message

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.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Benni Mack +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 6

Review log 1119

  1. Christian Kuhn uploaded patch set 1 06/11/21, 14:48

  2. core-ci voted on patch set 1 V +1 06/11/21, 14:58 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12307

  3. Christian Kuhn uploaded patch set 2 06/11/21, 17:01

  4. core-ci voted on patch set 2 V -1 06/11/21, 17:04 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12314

  5. Christian Kuhn uploaded patch set 3 06/11/21, 17:05

  6. core-ci voted on patch set 3 V +1 06/11/21, 17:15 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12315

  7. Christian Kuhn uploaded patch set 4 06/11/21, 17:29

  8. core-ci voted on patch set 4 V +1 06/11/21, 17:37 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12316

  9. Christian Kuhn uploaded patch set 5 06/11/21, 18:26

  10. core-ci voted on patch set 5 V -1 06/11/21, 18:38 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12317

  11. Christian Kuhn uploaded patch set 6 06/11/21, 18:47

  12. core-ci voted on patch set 6 V +1 06/11/21, 18:58 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12318

  13. Christian Kuhn uploaded patch set 7 06/11/21, 19:16

  14. Christian Kuhn uploaded patch set 8 06/11/21, 19:21

  15. core-ci voted on patch set 7 V +1 06/11/21, 19:27 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12319

  16. core-ci voted on patch set 8 V +1 06/11/21, 19:30 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12320

  17. Benni Mack voted on patch set 8 V +1 CR +1 06/12/21, 16:00

  18. Anja Leichsenring voted on patch set 8 V +2 CR +2 06/12/21, 20:59

  19. Anja Leichsenring merged patch set 9 06/12/21, 20:59