Skip to content

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

Merged
sbuerk merged 1 commit into
TYPO3:mainfrom
calien666:json-response-without-testing-context
Nov 25, 2026
Merged

sbuerk merged 1 commit into
TYPO3:mainfrom
calien666:json-response-without-testing-context

Conversation

@calien666

Copy link
Copy Markdown
Contributor

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: TYPO3#761
Releases: main, 9
@sbuerk
sbuerk merged commit b0da164 into TYPO3:main Nov 25, 2026
5 of 8 checks passed
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.

json_response: FrontendUserHandler and BackendUserHandler fail on requests without typo3.testing.context

2 participants