Review 14.3 Merged

94947[TASK] Avoid frontend context leak in extbase controller tests

Benni Mack CR +2 V +2 Normal +58 −1 updated 09/02/26, 12:44

Commit message

BlogPostEditingControllerTest relied on state leaking from frontend
sub-requests into the test scope: executeFrontendSubRequest() boots
the frontend application via Bootstrap::init(), which registers a
fresh DI container globally, and the testing framework does not
restore the previous container afterwards. Extbase repository calls
made after a sub-request therefore ran with the language aspect of
the frontend request instead of the default language context.

On top of that, the Extbase persistence session of the frontend
request was reused when mapping query results in test scope: the
language-aware identity map matched the leaked language aspect, so
assertions were satisfied by the in-memory object graph of the form
submission and never verified persisted database state.

The tests now reset the leaked language aspect (a workaround until
the testing framework restores the container), fetch the updated
translation with an explicitly set language aspect, and assert
against actual database content. This uncovers that MM relation
changes of a translated aggregate root are written against the
default language record, while reading resolves MM relations via the
localized uid. The affected assertions document this inconsistency
and are marked to be adapted once write and read side agree on which
uid owns the MM rows of a translated record.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 4

Files 1

Review log 46

  1. Benni Mack commented on patch set 1 07/26/26, 15:10

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/26/26, 15:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105424

  3. Benni Mack rebased onto patch set 2 V +1 09/02/26, 12:13

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

  5. Stefan Bürk voted on patch set 2 CR +2 V +2 09/02/26, 12:44

  6. Stefan Bürk merged patch set 3 09/02/26, 12:44