Bug #54903

TemplateService runs processIncludes twice when TypoScript is not in cache

Added by Peter Niederlag over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2014-01-10
Priority:Should have Due date:
Assigned To:Peter Niederlag % Done:

100%

Category:- Spent time: -
Target version:-
TYPO3 Version:6.2 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

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).

Related issues

related to Core - Bug #54897: Wrong lineNumbers and templateNames in TypoScript-Object-... Resolved 2014-01-10

Associated revisions

Revision cbbc7853
Added by Peter Niederlag over 1 year ago

[BUGFIX] Don't run processIncludes more than once

processIncludes() is run "mandatory" from the stack >start()
>runThroughTemplates() and doing all the work that needs to be done.

Resolves: #54903
Releases: 6.2
Change-Id: Id2be1a25aa23a05849297315c74358a9ef4ff9bb
Reviewed-on: https://review.typo3.org/26748
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein

History

#1 Updated by Gerrit Code Review over 1 year 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

#2 Updated by Gerrit Code Review over 1 year 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

#3 Updated by Gerrit Code Review over 1 year 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

#4 Updated by Gerrit Code Review over 1 year 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

#5 Updated by Gerrit Code Review over 1 year 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

#6 Updated by Gerrit Code Review over 1 year 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

#7 Updated by Gerrit Code Review over 1 year 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

#8 Updated by Gerrit Code Review over 1 year 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

#9 Updated by Gerrit Code Review over 1 year 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

#10 Updated by Gerrit Code Review over 1 year 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

#11 Updated by Anonymous over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF