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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 6