Review 14.3 Merged

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

Benni Mack CR +2 V +2 Normal +163 −17 updated 11/11/26, 16:11

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
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 711

  1. Benni Mack commented on patch set 1 11/10/26, 14:38

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/form/Tests/Functional/EventListener/DataStructureIdentifierListenerTest.php
  2. Benni Mack commented on patch set 2 11/10/26, 14:40

    Published edit on patch set 1.
  3. Benni Mack marked it ready for review 11/10/26, 14:40

  4. core-ci voted on patch set 1 V -1 11/10/26, 14:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113910

  5. core-ci voted on patch set 2 V -1 11/10/26, 14:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113912

  6. Benni Mack commented on patch set 3 V -1 11/11/26, 13:50

    Published edit on patch set 2.
  7. core-ci voted on patch set 3 V -1 11/11/26, 14:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114091

  8. Benni Mack uploaded patch set 4 V -1 11/11/26, 14:27

  9. core-ci voted on patch set 4 V +1 11/11/26, 14:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114099

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

  11. Benni Mack merged patch set 5 11/11/26, 16:11