Actions
Bug #54903
closedTemplateService runs processIncludes twice when TypoScript is not in cache
Start date:
2014-01-10
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
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).
Actions