Bug #54903
closedTemplateService runs processIncludes twice when TypoScript is not in cache
100%
Description
TYPO3\CMS\Core\TypoScript\TemplateService¶
->processIncludes() is run "mandatory" from the stack ->start() ->runThroughTemplates() and doing all the work that needs to be done.
However if there is no entry in the caching framework for the parsed (transformed into array) TypoScript then ->processIncludes() is run a second time from within ->generateConfig(). The TypoScript does not change (exept one extra LF added into each Template with an <INCLUDE_TYPOSCRIPT instruction). There is no reason to call processIncludes() a second time.
How to check/reproduce¶
- See the difference in lineNumbers in TypoScript-Object-Browser and Template-Analyzer in BE. You get 1 line offset per template that has an INCLUDE_TYPOSCRIPT instruction.
- Put a debug statement inside of processIncludes() and check the frontend in cached / non-cached states and see that it is run twice after the cache has been cleared in BE. If you compare substr_count($value, LF); before and after checkIncludeLines() is called inside processIncludes() you will find: On first run INCLUDE_TYPOSCRIPT is executed and line numbers are different, which makes perfect sense. When the TS is not found in the cache and processIncludes() is executed the second time for some very weird reason line numbers are +1 if the template has an INCLUDE_TYPOSCRIPT (that was already processed). The TypoScript itself is exactly the same, except for this extra empty line, which won't be part of the hash-calculation and gone again on the next page-cycle (when the TS is found in cache).
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review almost 11 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review over 10 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review over 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review over 10 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Gerrit Code Review over 10 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26748
Updated by Anonymous over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cbbc78539932566f469d8e7f1ec0fb72181347a3.