Bug #102892
open
RuntimeException when using redirects with record link targets
Added by Christian Gebing 4 months ago.
Updated about 2 months ago.
Category:
Redirect Handling
Description
I get the following exception for redirects with record links targets after the site is stored in the cache:
(1/1) #1666513645 RuntimeException
Setup array has not been initialized. This happens in cached Frontend scope where full TypoScript is not needed by the system.
Steps to reproduce:
- Flush caches via the maintanance tool
- Add a new redirect with a record link target (e.g. t3://record?identifier=example&uid=1)
- Follow the redirect
- Open the start page or any other page on the current site
- Attempt to follow the redirect again
Tested on a minimal TYPO3 ddev setup: https://github.com/cgebing/typo3_record_link_test
Files
- Assignee set to Stefan Bürk
I can reconstruct this issue.
It disappears, when clearing the frontend cache, then the redirects work as expected.
But as soon as I call the front page (the first page in rootLine, which contains the TypoScript setup) and this page gets cached, the redirect break, with the exception from above.
I tried several TYPO3 versions. This issue seems to occure since 12.4.2. In 12.4.1 I am not able to reconstruct the issue, by calling the first page in rootLine (the front page). There, the redirections always work.
A quick fix is, to disable caching on the first page in rootLine, with e.g.
# Quick fix for https://forge.typo3.org/issues/102892
[traverse(page, "uid") == 1]
config.no_cache = 1
[end]
Absolutely not ideal or recommended, but this solves the issue, which only occures when the first page is being cached.
@Oliver Hader So, when CSP is on the page cache does not work anymore? Sounds a little bit like that.
@Benni Mack Caching and providing the rendered Typoscript configuration, could solve this, maybe?
Or the redirect Middleware must get enabled to parse the Typoscript, when being triggered and when the target starts with "t3:".
But maybe there are other edge cases, like redirects, which require the parsed Typoscript config.
Also available in: Atom
PDF