FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
190 stars 229 forks source link

[BUGFIX] Fix Problems with TYPO3 v12.x and cached pages #1855

Closed Neowar closed 11 months ago

Neowar commented 1 year ago

If a page is cached, the determination of the TypoScript setup fails. A RuntimeException with the code 1666513645 is thrown (\TYPO3\CMS\Core\TypoScript\FrontendTypoScript()->getSetupArray()). This happens in the context of the middleware AssetInclusion.

To prevent this, the exception must be caught in the AssetService in the getSettings() function.

NamelessCoder commented 11 months ago

Thanks for the patch, @Neowar - but this problem should not be fixed by suppressing the exception. The problem is that on some compositions of middlewares, VHS's asset inclusion somehow ends up before typo3/cms-frontend/prepare-tsfe-rendering which is where the TypoScript gets set, which when missing causes the exception.

The correct solution is to use middleware configuration to ensure that VHS asset inclusion happens after typo3/cms-frontend/prepare-tsfe-rendering (but before any other middlewares that measure/manipulate page content).