Review main Merged

95826[BUGFIX] Translate form flex form data structure without $LANG

Georg Ringer CR +2 V +2 Normal +155 −12 updated 11/10/26, 14:40

Commit message

Record->toArray() evaluates TCA fields and parses flex forms, which
dispatches AfterFlexFormDataStructureParsedEvent in the frontend as
well. Its listener of ext:form read $GLOBALS['LANG'], which the
frontend only sets up while a backend user is logged in. Rendering a
page holding a form plugin as an anonymous visitor therefore raised
"Undefined global variable $LANG".

DataStructureIdentifierListener now resolves the language service
itself: an existing $GLOBALS['LANG'] is used as before, otherwise the
site language of the current request, otherwise the backend user
preferences, which also covers CLI. The resolved service is handed
over to FinisherOptionGenerator, so it no longer reaches into the
global scope either.

The constructor declaration of ProcessorInterface had to go for that.
The interface is internal, its contract is __invoke(), and declaring
constructors in interfaces blocks implementations from taking their
own dependencies.

Review

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

Issues 1

Files 4

Review log 1620

  1. Georg Ringer uploaded patch set 1 09/14/26, 21:50

  2. core-ci voted on patch set 1 V +1 09/14/26, 21:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108558

  3. Georg Ringer rebased onto patch set 2 V +1 09/16/26, 09:18

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

  5. Georg Ringer commented on patch set 2 10/02/26, 16:22

    This change is ready for review.
  6. Wouter Wolters voted on patch set 2 CR +1 V +1 10/02/26, 16:51

  7. Oli Bartsch commented on patch set 2 10/02/26, 20:00

    FinisherOptionGenerator.php:99

    Why do we keep this method? Could we just use the class property directly?
  8. Georg Ringer uploaded patch set 3 CR +1 V +1 10/24/26, 06:05

  9. Georg Ringer commented on patch set 3 10/24/26, 06:05

    FinisherOptionGenerator.php:99 Reply

    Done
  10. core-ci voted on patch set 3 V +1 10/24/26, 07:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112393

  11. Wouter Wolters voted on patch set 3 CR +1 V +1 10/24/26, 07:02

  12. Simon Schaufelberger voted on patch set 3 CR +1 V +1 11/06/26, 00:49

  13. Josua Vogel uploaded patch set 4 CR +1 V +1 11/10/26, 11:20

  14. Josua Vogel voted on patch set 4 CR +1 11/10/26, 11:21

  15. Josua Vogel commented on patch set 4 11/10/26, 11:23

    added a functional test for the FinisherOptionGenerator path the issue reports (fails with "Undefined global variable $LANG" without the fix), a tearDown() resetting $GLOBALS['TYPO3_REQUEST'], and turned the test comment into a docblock without the issue URL.
  16. core-ci voted on patch set 4 V +1 11/10/26, 11:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113888

  17. Josua Vogel voted on patch set 4 V +1 11/10/26, 12:59

  18. Benni Mack voted on patch set 4 CR +1 V +1 11/10/26, 14:32

  19. Benni Mack voted on patch set 4 CR +2 V +2 11/10/26, 14:40

  20. Benni Mack merged patch set 5 11/10/26, 14:40