Skip to content

[BUGFIX] Pass on requests without testing context in json_response - #763

Merged
sbuerk merged 1 commit into
9from
backport-762
Nov 25, 2026
Merged

sbuerk merged 1 commit into
9from
backport-762

Conversation

@sbuerk

@sbuerk sbuerk commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

FrontendUserHandler and BackendUserHandler of the json_response
extension read the typo3.testing.context attribute and call methods on
it unconditionally. Only requests dispatched through
FunctionalTestCase::executeFrontendSubRequest() carry that attribute.

A frontend request the code under test builds and dispatches itself
reaches the same middleware stack without it and fails with:

Call to a member function getFrontendUserId() on null

Both middlewares now pass such a request on unchanged, since it has no
test user to log in and no workspace to force.

Resolves: #761
Releases: main, 9

FrontendUserHandler and BackendUserHandler of the json_response
extension read the typo3.testing.context attribute and call methods on
it unconditionally. Only requests dispatched through
FunctionalTestCase::executeFrontendSubRequest() carry that attribute.

A frontend request the code under test builds and dispatches itself
reaches the same middleware stack without it and fails with:

  Call to a member function getFrontendUserId() on null

Both middlewares now pass such a request on unchanged, since it has no
test user to log in and no workspace to force.

Resolves: #761
Releases: main, 9
@sbuerk
sbuerk merged commit 42f03e9 into 9 Nov 25, 2026
8 checks passed
@sbuerk
sbuerk deleted the backport-762 branch November 25, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants