Review main Merged

92870[TASK] Allow Extbase models in `f:render.text` ViewHelper

Matthias Vogel CR +2 V +2 Hard +286 −137 updated 02/24/26, 06:58

Commit message

Theme creators can now also use this ViewHelper with Extbase models.

Review

  • Code review CR +2 Done
    • Simon Praetorius +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Simon Praetorius +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 3143

Show 1218 earlier messages
  1. Matthias Vogel uploaded patch set 1 02/17/26, 16:21

  2. core-ci voted on patch set 1 V -1 02/17/26, 16:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96067

  3. Matthias Vogel updated the commit message in patch set 2 V -1 02/17/26, 16:33

  4. core-ci voted on patch set 2 V -1 02/17/26, 16:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96069

  5. Matthias Vogel uploaded patch set 3 V -1 02/17/26, 16:59

  6. core-ci voted on patch set 3 V +1 02/17/26, 17:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96072

  7. Matthias Vogel marked it ready for review 02/17/26, 17:11

  8. Matthias Vogel uploaded patch set 4 V +1 02/17/26, 17:29

  9. Garvin Hicking commented on patch set 4 02/17/26, 17:33

    ModelToRawRecordService.php:28

    How about "RawRecordConversionService" or "ConvertModelToRawRecordService" or "DomainModelConversionService" or "DomainModelTransformationService"? I'm missing what "to" refers to for clarity in naming.

    ModelToRawRecordService.php:37

    ```suggestion * and transforms it into a RawRecord that can be used if a RecordInterface is needed. ```

    ModelToRawRecordService.php:44

    ```suggestion $languageField = $dataMap->getLanguageIdColumnName(); ``` (Also other usages)

    ModelToRawRecordService.php:59

    Maybe stricter null check here for safety?

    ModelToRawRecordService.php:62

    Accessing ObjectStorage should IMO be covered, especially for fal/category and other resolving? Then we are also quite close to this feature request that I just said "don't hold your breath": https://forge.typo3.org/issues/101125#change-562284 :-D

    TextViewHelper.php:37

    This should be explained (with examples) in the ReST - underscore/lower/upper/camelcasing in Extbase is a minefield ;)
  10. core-ci voted on patch set 4 V +1 02/17/26, 17:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96073

  11. Oli Bartsch commented on patch set 4 02/18/26, 07:45

    ModelToRawRecordService.php:28

    This is more a Migration/Migrator (naming-wise).

    ModelToRawRecordService.php:37 Reply

    ```suggestion * and transforms it into a RawRecord that can be used when a RecordInterface is needed. ```
  12. Matthias Vogel uploaded patch set 5 V +1 02/18/26, 09:00

  13. core-ci voted on patch set 5 V -1 02/18/26, 09:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96108

  14. Matthias Vogel commented on patch set 5 02/18/26, 09:09

    ModelToRawRecordService.php:28 Reply

    Done

    ModelToRawRecordService.php:37 Reply

    Done

    ModelToRawRecordService.php:44 Reply

    Done

    ModelToRawRecordService.php:59 Reply

    Done

    ModelToRawRecordService.php:62 Reply

    Done

    TextViewHelper.php:37 Reply

    Done
  15. Matthias Vogel uploaded patch set 6 V -1 02/18/26, 09:33

  16. Matthias Vogel commented on patch set 6 02/18/26, 09:33

    ModelToRawRecordService.php:28 Reply

    Done
  17. core-ci voted on patch set 6 V -1 02/18/26, 10:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96110

  18. Matthias Vogel uploaded patch set 7 V -1 02/18/26, 11:54

  1. core-ci voted on patch set 7 V -1 02/18/26, 12:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96126

  2. Simon Praetorius commented on patch set 7 02/18/26, 16:26

    ModelToRawRecordService.php:28 Reply

    Why is this done? :) I would also prefer a different name, something like `DomainObjectConverter` or even just a second (internal) `RecordFactory`? And the method name should then be adjusted accordingly

    ModelToRawRecordService.php:62

    isn't that the same as `is_scalar() || === null`?

    TextViewHelper.php:51

    This is a deeper issue in Fluid that we cannot easily resolve. Thus, we should explain why this isn't a problem here (input is always an object, ViewHelper takes care of escaping internally).
  3. Matthias Vogel uploaded patch set 8 V -1 02/19/26, 07:20

  4. Matthias Vogel commented on patch set 8 02/19/26, 07:21

    ModelToRawRecordService.php:28 Reply

    it is currently called: `\TYPO3\CMS\Extbase\Migrator\ModelToRawRecordMigrator`

    ModelToRawRecordService.php:62 Reply

    Done

    TextViewHelper.php:51 Reply

    Done
  5. Matthias Vogel uploaded patch set 9 02/19/26, 07:27

  6. core-ci voted on patch set 8 V +1 02/19/26, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96216

  7. core-ci voted on patch set 9 V +1 02/19/26, 07:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96217

  8. Simon Praetorius commented on patch set 9 CR -1 02/19/26, 12:50

    Feature-108868-IntroduceFluidRenderTextViewHelper.rst:62

    Note that Extbase models need to contain all columns that should be rendered and the record type column (if configured in TCA) for this to work correctly. For example, an Extbase model that represents `tt_content` must map both `bodytext` and `ctype` to be able to use :html:`<f:render.text record="{contentModel}" field="bodytext" />`.

    ModelToRawRecordMigrator.php:34

    As discussed, I think it makes sense to reduce the functionality to an absolute minimum and to potentially copy this to the ViewHelper, at least for now. From my point of view, the current code demonstrates that we're trying to add something that wasn't meant to be added like this.

    ModelToRawRecordMigrator.php:46

    I think it should be clarified here what the goal is exactly: To reverse-engineer the persisted row in the database or to extract the current state of the model if it were persisted (= with current changes that are not persisted yet). The comment suggests that additional database queries would be an alternative option, which would only be the case for variant 1. I'd argue that the goal is variant 2, so extracting from the object is the only option.
  9. Matthias Vogel uploaded patch set 10 CR -1 V +1 02/19/26, 15:44

  10. Matthias Vogel commented on patch set 9 02/19/26, 15:46

    Feature-108868-IntroduceFluidRenderTextViewHelper.rst:62 Reply

    Done

    ModelToRawRecordMigrator.php:34 Reply

    As discussed, we remove this Migrator and handle only the necessary fields inside TextViewHelper.

    ModelToRawRecordMigrator.php:46 Reply

    As discussed, we remove this Migrator and handle only the necessary fields inside TextViewHelper.
  11. Matthias Vogel commented on patch set 10 02/19/26, 15:48

    TextViewHelper.php:184

    We need to decide whether we want this fallback. Currently, I'm against it because it only complicates things for the user.
  12. core-ci voted on patch set 10 V +1 02/19/26, 15:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96263

  13. Simon Praetorius commented on patch set 10 02/19/26, 18:48

    TextViewHelper.php:156

    I think this should be just `DomainObjectInterface $input`

    TextViewHelper.php:184 Reply

    I would also start with the simplest option, so no fallback.
  14. Matthias Vogel uploaded patch set 11 V +1 02/20/26, 06:56

  15. Matthias Vogel commented on patch set 11 02/20/26, 06:57

    TextViewHelper.php:156 Reply

    Done

    TextViewHelper.php:184 Reply

    removed for now
  16. core-ci voted on patch set 11 V +1 02/20/26, 07:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96303

  17. Simon Praetorius commented on patch set 11 CR +1 V -1 02/22/26, 18:38

    Unfortunately, this no longer works with my local example (generic `tt_content` model with no further mapping). The problem seems to be that the mapping between `CType` (database) and `ctype` (Extbase Model) no longer works, which it did with the separate service class.
  18. Simon Praetorius voted on patch set 11 CR 0 02/22/26, 18:39

  19. Matthias Vogel uploaded patch set 12 V +1 02/23/26, 08:10

  20. Matthias Vogel commented on patch set 12 02/23/26, 08:11

    Reply

    Added test case for this problem. Works now.
  21. core-ci voted on patch set 12 V +1 02/23/26, 08:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96541

  22. Simon Praetorius voted on patch set 12 CR +1 V +1 02/23/26, 16:04

  23. Garvin Hicking voted on patch set 12 CR +1 V +1 02/23/26, 16:26

  24. Simon Praetorius voted on patch set 12 CR +2 V +2 02/24/26, 06:57

  25. Simon Praetorius merged patch set 13 02/24/26, 06:58