#99655Backend: Set correct Site in site attribute of request when the current request has sufficient contextual information
Description
With the introduction of the site-config we added more and more multisite-specific features, that are configured in the site-config.
This works perfectly for the frontend. But when you rely on the site-config in the backend, you will need to add a middleware, that sets an internal site attribute for various backend routes. Otherwise you will often just have a NullSite, which is useless.
An example would be: You implement an api and each site has its own credentials because the site should only have access to a subset of data. So you configure the credentials in the site-config. But if you need to add some backend-features, that needs those credentials, you will often need to determine the rootpage by grabbing some id from the current queryParams and then retrieving the site-config from the rootpage id.
In my opinnion the site-config should be available whenever possible.
for example – it is possible to determine the site and set it as attribute when:
- you edit the site config itself
- you edit any tca record located inside the page-tree
- on any view you have relation to a page uid
At the moment i need to add a middleware for each extension, that makes extensive use of the site configuration.
Unfortunately i did not test the behaviour in V11, so i need to tag the typo3 version to 10. Once i can confirm this still exists in V11/V12, i can update this issue.
Update
This is still valid for V11/V12.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[TASK] Backend: Set correct Site in site attribute of request when the current request has sufficient contextual information Resolves: #99655 Releases: main