Review main Merged

75247[BUGFIX] Do not hide ContentObjectRenderer on form rendering

Elias Häußler CR +2 V +2 Easy +16 −1 updated 08/15/22, 07:54

Commit message

With #93887 (respectively #92406), a more convenient rendering
mechanism for forms was introduced. A new FormRequestHandler
centralized all the logic from the <formvh:render> view helper
to allow smoother form handling. However, the new implementation
used to hide the current ContentObjectRenderer implementation
and instead always fetched a new instance with
GeneralUtility::makeInstance().

This no longer allows to determine the current content object
rendering context from e.g. form finishers. Since the current
implementation can be retrieved by the ConfigurationManager,
it is now used in the <formvh:render> view helper, falling
back to a new ContentObjectRenderer instance in case the
ConfigurationManager does not actually provide an instance
of ContentObjectRenderer.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • waldhacker +1
    • Moritz Ngo +1
  • Verified V +2 Done
    • Oliver Hader +2
    • waldhacker +1
    • Moritz Ngo +1
    • core-ci +1 CI

Issues 3

Files 1

Review log 1315

  1. Elias Häußler uploaded patch set 1 07/20/22, 14:59

  2. Elias Häußler updated the commit message in patch set 2 07/20/22, 15:05

  3. core-ci voted on patch set 1 V +1 07/20/22, 15:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29378

  4. core-ci voted on patch set 2 V +1 07/20/22, 15:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29379

  5. Oliver Hader voted on patch set 2 CR +1 07/26/22, 14:23

  6. Oliver Hader commented on patch set 2 07/26/22, 14:45

    I just re-reviewed the previous patch that introduced this behavior. But I could not determine at which point this was removed/changed...
  7. waldhacker voted on patch set 2 CR +1 07/26/22, 14:50

  8. waldhacker voted on patch set 2 V +1 07/26/22, 14:56

  9. Elias Häußler commented on patch set 2 07/26/22, 15:13

    Reply

    Since the ConfigurationManager (from my knowledge) is the only way to fetch the current content element's cObj, the current instance is overwritten at this point: https://github.com/TYPO3/typo3/commit/9f933f2#diff-5f0031fc3ccd569c3f288c9466d7b7e0bcf0ee8d4c7ce41ea6feaafdecebe611R251
  10. Oliver Hader commented on patch set 2 07/26/22, 17:49

    Reply

    Thanks! I overlooked that line - (base Extbase) ConfigurationManager is a singleton and still holds that `cObj` instance.
  11. waldhacker commented on patch set 2 V +2 CR +2 08/08/22, 13:15

    Reply

    Done
  12. waldhacker voted on patch set 2 V +1 CR +1 08/08/22, 13:19

  13. Moritz Ngo voted on patch set 2 V +1 CR +1 08/12/22, 23:25

  14. Oliver Hader voted on patch set 2 V +2 CR +2 08/15/22, 07:53

  15. Oliver Hader merged patch set 3 08/15/22, 07:54