Skip to content

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

Open
calien666 wants to merge 1 commit into
TYPO3:mainfrom
calien666:json-response-without-testing-context
Open

calien666 wants to merge 1 commit into
TYPO3:mainfrom
calien666:json-response-without-testing-context

Conversation

@calien666

Copy link
Copy Markdown

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
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

1 participant