Review main Merged

94969[TASK] Add contextual option to editRecord ViewHelper

Tim Bäcker CR +2 V +2 Normal +129 −3 updated 08/07/26, 14:27

Commit message

Extend be:link.editRecord with an optional contextual flag that renders
the contextual edit trigger with classic FormEngine fallback, keeping
the shared URL-building logic in one place. The ViewHelper also loads
the required JavaScript module automatically.

Review

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

Issues 1

Files 3

Review log 1621

  1. Tim Bäcker uploaded patch set 1 07/28/26, 09:26

  2. core-ci voted on patch set 1 V +1 07/28/26, 09:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105527

  3. Garvin Hicking commented on patch set 2 V +1 07/28/26, 10:43

    Published edit on patch set 1.
  4. core-ci voted on patch set 2 V +1 07/28/26, 10:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105532

  5. Oli Bartsch commented on patch set 2 07/28/26, 16:35

    Hey, I tbh don‘t see the benefit of adding a VH just as wrapper for the web component. I suggest to just use the web component directly in the template. The urls should be generated by the corresponding controller or alternatively with one of the existing uri/link VHs.
  6. Benni Mack commented on patch set 2 07/28/26, 17:00

    Reply

    should we just use a "<f:be.editRecord contextual="true" />"
  7. Tim Bäcker commented on patch set 2 07/29/26, 07:17

    Reply

    Thanks for the feedback. The motivation is mainly Content Blocks backend previews: Fluid-only templates, no dedicated controller. Content Blocks even auto-generates edit buttons with a minimal fields set for created page-types. Right now that minimal edit only works via full-page be:link.editRecord, while contextual editing from the page module shows the full field set, which feels backwards. If anything, the more minimal fieldset should be the one using the contextual overlay. I had considered extending be:link.editRecord with something like contextual="true" (as Benni suggested), but I was unsure whether that would be the clearest API: Contextual editing is not only a different route. Core renders a different element (<typo3-backend-contextual-record-edit-trigger> instead of an <a> tag) and needs both URLs: record_edit_contextual as primary target and record_edit as fallback. be:link.editRecord is, to my understanding, meant to render a "normal edit link". A boolean flag would change both the generated markup shape and the behavior quite substantially, which felt a bit surprising for a link.* ViewHelper. A dedicated ViewHelper would mirror what core already does in the page module and keep the existing be:link.editRecord contract unchanged. That said, I completely understand Oli’s point about not wanting a ViewHelper that is mostly a thin wrapper around the web component. Using the component directly in Fluid is possible, but in Content Blocks previews it gets awkward quickly: you need to build the nested edit[table][uid] parameter structure, map fields to columnsOnly, and generate both URLs - all in Fluid without a controller. I am happy to rework the patch if extending the existing ViewHelper is preferred.
  8. Oli Bartsch commented on patch set 2 07/31/26, 09:21

    Reply

    Hey, thanks for explaining the motivation. I still think the duplication is the bigger issue though. I diffed this against `EditRecordViewHelper` and it's a near-verbatim copy (constructor, initializeArguments(), returnUrl/module fallback, $params/columnsOnly logic all identical). Only the tag name, the extra attribute, and the exception type differ. I'd rather see this as a contextual flag on EditRecordViewHelper (swap tag + add edit-url when set), or a thin subclass overriding just the tail of render(), than a full second copy. This keeps the shared URL-building logic in one place.
  9. Tim Bäcker uploaded patch set 3 V +1 07/31/26, 10:47

  10. Tim Bäcker commented on patch set 3 07/31/26, 10:50

    Reply

    Fair point. I’ve reworked the patch: removed the dedicated ViewHelper and added a contextual flag to EditRecordViewHelper instead.
  11. core-ci voted on patch set 3 V +1 07/31/26, 10:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105751

  12. Oli Bartsch commented on patch set 3 07/31/26, 16:50

    Reply

    Nice, thank you. This looks really good. I would actually call this a TASK instead of a feature and make it available on v14 as well. We could add a Important ReST file anyways to document the new argument. What do you think?
  13. Tim Bäcker uploaded patch set 4 V +1 08/05/26, 11:31

  14. Tim Bäcker commented on patch set 4 08/05/26, 11:37

    Reply

    Done. changed this to a TASK, documented with a ReST file, and set Releases to main, 14.3. The 14.3 backport is available as well: https://review.typo3.org/c/Packages/TYPO3.CMS/+/95114
  15. core-ci voted on patch set 4 V +1 08/05/26, 11:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105974

  16. Tim Bäcker uploaded patch set 5 V +1 08/07/26, 09:05

  17. core-ci voted on patch set 5 V +1 08/07/26, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106105

  18. Garvin Hicking commented on patch set 5 CR +1 V +1 08/07/26, 11:49

    Reply

    Done
    Thanks a lot, works for me now! 😊
  19. Benni Mack voted on patch set 5 CR +1 V +1 08/07/26, 13:38

  20. Garvin Hicking voted on patch set 5 CR +2 V +2 08/07/26, 14:27

  21. Garvin Hicking merged patch set 6 08/07/26, 14:27