Review main Merged Breaking

94352[!!!][TASK] Make StandardContentPreviewRenderer stateless

Christian Kuhn CR +2 V +2 Expert +567 −700 updated 06/11/26, 09:19

Commit message

StandardContentPreviewRenderer carried a lazy initialize()
workaround that filled its dependencies through makeInstance().
It existed because subclasses have been doing constructor based
dependency injection since v11 without ever calling the parent
constructor. The class was therefore mutable, subclassable and
implemented LoggerAwareInterface even though it never logged
anything. This workaround was reintroduced with #108906 to keep
extension authors' DI-based subclasses working.

The patch turns it into a final, readonly service that receives
all of its dependencies through the constructor, and drops both
the lazy initialization workaround and the unused logger.

The class is final now, ext:form subclass FormPagePreviewRenderer
no longer extends it. It implements PreviewRendererInterface
instead, composes StandardContentPreviewRenderer and delegates the
header rendering to it. This composition over inheritance is what
makes dropping the workaround safe. FormPagePreviewRenderer is
internal and moved to a better fitting namespace along the way.

Also, FluidBasedContentPreviewRenderer is simplified a bit,
RecordFieldPreviewProcessor becomes a readonly class, and
its unit tests are merged into the functional test case.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 3

Files 9

Review log 811

  1. Christian Kuhn uploaded patch set 1 06/08/26, 02:32

  2. core-ci voted on patch set 1 V -1 06/08/26, 02:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103097

  3. Christian Kuhn uploaded patch set 2 V -1 06/09/26, 21:58

  4. core-ci voted on patch set 2 V +1 06/09/26, 22:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103251

  5. Christian Kuhn uploaded patch set 3 V +1 06/09/26, 22:29

  6. core-ci voted on patch set 3 V +1 06/09/26, 22:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103252

  7. Nikita Hovratov voted on patch set 3 CR +1 06/10/26, 08:29

  8. Stefan Bürk voted on patch set 3 CR +1 V +1 06/10/26, 13:35

  9. Oliver Klee voted on patch set 3 V +1 06/11/26, 07:49

  10. Christian Kuhn voted on patch set 3 CR +2 V +2 06/11/26, 09:19

  11. Christian Kuhn merged patch set 4 06/11/26, 09:19