Review main Ready for review

92662[FEATURE] Add PSR-14 event to adjust QR code rendering

Georg Ringer CR -2 V +1 Hard +362 −7 updated 11/16/26, 11:49

Commit message

The backend renders QR codes for preview URLs and redirects. The new
event BeforeQrCodeRenderedEvent is dispatched before rendering and
lets listeners replace the BaconQrCode renderer style, so colors and
shapes can follow a corporate identity without rendering twice.

Listeners can also assign the SVG markup directly. TYPO3 then skips
its own rendering, which covers what the renderer style cannot
express, for example placing a logo in the center of the code.

The request is handed to listeners so they can pick up any further
context themselves.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 6
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/62/92662/6 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/62/92662/6 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -2 Blocked
    • Benni Mack -2
    • Markus Klein +1
    • Josua Vogel +1
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Markus Klein +1
    • Josua Vogel +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 1

Issues 1

Files 5

Review log 2229

Show 4 earlier messages
  1. Georg Ringer uploaded patch set 1 02/04/26, 13:07

  2. Georg Ringer commented on patch set 1 02/04/26, 13:08

    This change is ready for review.
  3. Georg Ringer uploaded patch set 2 02/04/26, 13:12

  4. Markus Klein voted on patch set 2 CR +1 02/04/26, 13:17

  1. Markus Klein commented on patch set 2 02/04/26, 13:18

    QrCodeController.php:115

    Optional idea: Introduce QR-renderer-Registry so we don't render stuff twice?
  2. Simon Schaufelberger commented on patch set 2 02/04/26, 13:22

    Feature-108854-PSR-14EventToModifyQrCodeSvg.rst:57

    Since this is an event listener, the class name should also have the suffix EventListener
  3. core-ci voted on patch set 1 V -1 02/04/26, 13:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95020

  4. Oli Bartsch commented on patch set 2 02/04/26, 13:49

    QrCodeController.php:115 Reply

    Yes, that came to mind when I saw the event is dispatched after the SVG has already been rendered. However, maybe we can skip a full registry and just register a default event listener in EXT:backend. Due to loading order, extension listeners could intercept it — or alternatively, if we don't want to rely on loading order, the listener service can just be disabled via container config.

    Feature-108854-PSR-14EventToModifyQrCodeSvg.rst:25

    What's the point of providing rendered SVG markup here?

    Feature-108854-PSR-14EventToModifyQrCodeSvg.rst:57 Reply

    I would like to stick to our latetst changelogs and use the PHP Attribute on method level.
  5. core-ci voted on patch set 2 V -1 02/04/26, 13:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95021

  6. Garvin Hicking commented on patch set 2 02/04/26, 14:52

    QrCodeController.php:115 Reply

    I'm also in favor of having an authoritative render listener which can be replaced. I'd like to keep the possibility to getSvg() though, so custom listeners could just enrich the created SVG in postprocessing.
  7. Markus Klein commented on patch set 2 02/04/26, 14:57

    QrCodeController.php:115 Reply

    Thinking even further: QR codes might be specific per site
  8. Simon Schaufelberger uploaded patch set 3 CR +1 V -1 03/27/26, 08:55

  9. Simon Schaufelberger commented on patch set 2 03/27/26, 08:56

    QrCodeController.php:115 Reply

    I added the Site. Anybody wants to suggest the proposed event listener? I'm not sure about the implementation
  10. core-ci voted on patch set 3 V -1 03/27/26, 09:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98843

  11. Simon Schaufelberger rebased onto patch set 4 V -1 03/30/26, 23:37

  12. core-ci voted on patch set 4 V -1 03/30/26, 23:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99156

  13. core-ci commented on patch set 4 03/31/26, 00:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99191

  14. Georg Ringer uploaded patch set 5 V -1 09/09/26, 21:39

  15. core-ci voted on patch set 5 V +1 09/09/26, 21:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108218

  16. Markus Klein voted on patch set 5 CR +1 09/10/26, 09:40

  17. Wouter Wolters voted on patch set 5 CR +1 V +1 09/16/26, 19:15

  18. Georg Ringer uploaded patch set 6 CR +1 V +1 11/03/26, 21:02

  19. Georg Ringer commented on patch set 6 11/03/26, 21:04

    QrCodeController.php:115 Reply

    The event is dispatched before rendering, so the QR code is rendered only once. Listeners that need per-site output can match the encoded content against the site base URLs, as the request carries no resolved site. Post-processing of the SVG is covered by rendering it in the listener and assigning the result with setSvg().

    Feature-108854-PSR-14EventToModifyQrCodeSvg.rst:25 Reply

    Done

    Feature-108854-PSR-14EventToModifyQrCodeSvg.rst:57 Reply

    Done
  20. core-ci voted on patch set 6 V +1 11/03/26, 21:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113230

  21. Markus Klein voted on patch set 6 CR +1 V +1 11/04/26, 11:44

  22. Simon Schaufelberger voted on patch set 6 CR +1 V +1 11/06/26, 09:26

  23. Josua Vogel voted on patch set 6 CR +1 11/06/26, 09:31

  24. Josua Vogel voted on patch set 6 V +1 11/16/26, 11:41

  25. Benni Mack commented on patch set 6 CR -2 11/16/26, 11:49

    let me check sth before we get this in.