Bug #79662

Fluid caches default view paths

Added by Claus Due almost 2 years ago. Updated 10 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2017-02-07
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The issue can be reproduced as follows:

1) configure (and optionally register) a normal Extbase plugin to call a controller action
2) define this plugin as USER function (normal TS to render Extbase) on the PAGE TS object (any typeNum)
3) define multiple view paths for the extension containing the plugin
4) Install Flux and register a template as CType

Result:

Fluid is asked to return view paths for a the extension name at two different execution points - first, during bootstrapping (before TS is available) and then again after bootstrapping is done (when TS is available). Because Fluid uses the runtime cache to store retrieved template paths, the first fallbacks-only set of paths is cached and returned for the second request after TS is available.

End result is that Fluid ignores the TS paths.

Note:

Although this currently requires Flux to expose, the bug is not in Flux itself and cannot be properly prevented there. It is also possible to reproduce this problem by subscribing to a hook in TSFE which gets called before TS is parsed, and have this hook subscriber render a template from an extension which also contains a plugin that will be rendered as page content or via USER TS object. The first rendering will then cause the paths to be cached and subsequent renderings will not detect any TS path settings.

Solution:

The problem can be fixed by not allowing CMS Fluid's TemplatePaths to be stored in runtime cache when the paths are purely fallbacks. By caching only when the "configured paths" (read: specified using setters or defined in TS) we circumvent the problem.


Related issues

Related to TYPO3 Core - Task #82487: Revert TemplatePaths optimizations and regressions Closed 2017-09-14

Associated revisions

Revision 2464bbe0 (diff)
Added by Claus Due almost 2 years ago

[BUGFIX] Do not cache fallback View paths

This patch fixes an issue with TemplatePaths, where paths
for a given extension key get used at two execution points:

  • Before TS becomes available
  • At any time after TS becomes available

In this case, TemplatePaths holds on to the fallback paths
which the first rendering detects (since TS is not availble,
fallback paths get returned) and all subsequent rendering
of any template in that extension context, yields only the
fallback paths and ignores what is defined in TS.

By not allowing fallback paths to be cached in runtime, the
problem is prevented.

Change-Id: Idd0216f67f9a7f875a4509b34c9a32f66208db93
Resolves: #79662
Releases: master
Reviewed-on: https://review.typo3.org/51564
Tested-by: TYPO3com <>
Reviewed-by: Thomas Hohn <>
Reviewed-by: Morten Pless <>
Tested-by: Morten Pless <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Claus Due <>
Tested-by: Claus Due <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision 30c46719 (diff)
Added by Claus Due over 1 year ago

[BUGFIX] Remove runtime cache and early return from TemplatePaths

This patch removes the previously introduced runtime cache
and early returns from TemplatePaths, both of which were
implemented in an attempt to prevent excessive TypoScript
parsing - an issue which has since been solved by optimising
the TypoScript parsing enough that a cache and early return
is no longer necessary (no longer constitutes a significant
performance increase).

The early return and caching introduced regressions described
in the related forge issues. Removing both solves those problems.

In addition, the method resolving TypoScript paths is now
covered by extensive unit tests confirming everything from
merging to sorting of template paths. An average of 8 tests
cover the method's lines. Each of the expected behaviors
is now declared as specific test.

Change-Id: Ia6d505dcec7d77ad7aaeea9094d7d85a58553c63
Resolves: #82196
Resolves: #82181
Related: #79662
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53917
Tested-by: TYPO3com <>
Reviewed-by: Jigal van Hemert <>
Tested-by: Jigal van Hemert <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision 6e029278 (diff)
Added by Claus Due over 1 year ago

[BUGFIX] Remove runtime cache and early return from TemplatePaths

This patch removes the previously introduced runtime cache
and early returns from TemplatePaths, both of which were
implemented in an attempt to prevent excessive TypoScript
parsing - an issue which has since been solved by optimising
the TypoScript parsing enough that a cache and early return
is no longer necessary (no longer constitutes a significant
performance increase).

The early return and caching introduced regressions described
in the related forge issues. Removing both solves those problems.

In addition, the method resolving TypoScript paths is now
covered by extensive unit tests confirming everything from
merging to sorting of template paths. An average of 8 tests
cover the method's lines. Each of the expected behaviors
is now declared as specific test.

Change-Id: Ia6d505dcec7d77ad7aaeea9094d7d85a58553c63
Resolves: #82196
Resolves: #82181
Related: #79662
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53932
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review almost 2 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/51564

#2 Updated by Gerrit Code Review almost 2 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/51564

#3 Updated by Anonymous almost 2 years ago

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

#4 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved 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/53917

#5 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/53917

#6 Updated by Markus Klein over 1 year ago

  • Status changed from Under Review to Resolved

#7 Updated by Benni Mack about 1 year ago

  • Related to Task #82487: Revert TemplatePaths optimizations and regressions added

#8 Updated by Claus Due about 1 year ago

  • Status changed from Resolved to Accepted

#9 Updated by Gerrit Code Review about 1 year ago

  • Status changed from Accepted to Under Review

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/54140

#10 Updated by Gerrit Code Review about 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/54140

#11 Updated by Gerrit Code Review about 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/54140

#12 Updated by Gerrit Code Review about 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/54140

#13 Updated by Gerrit Code Review about 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/54140

#14 Updated by Gerrit Code Review about 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/54140

#15 Updated by Gerrit Code Review about 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/54140

#16 Updated by Gerrit Code Review about 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/54140

#17 Updated by Helmut Hummel about 1 year ago

  • Status changed from Under Review to Needs Feedback

Not sure if the regression fix patch also solves this one here. I would appreciate to have code that demonstrates bug and fix

#18 Updated by Gerrit Code Review about 1 year ago

  • Status changed from Needs Feedback to Under Review

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/54140

#19 Updated by Gerrit Code Review about 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#20 Updated by Gerrit Code Review about 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#21 Updated by Gerrit Code Review about 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#22 Updated by Gerrit Code Review about 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#23 Updated by Gerrit Code Review about 1 year ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#24 Updated by Gerrit Code Review about 1 year ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#25 Updated by Gerrit Code Review about 1 year ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#26 Updated by Gerrit Code Review about 1 year ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#27 Updated by Gerrit Code Review about 1 year ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#28 Updated by Gerrit Code Review about 1 year ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#29 Updated by Gerrit Code Review about 1 year ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#30 Updated by Gerrit Code Review about 1 year ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#31 Updated by Gerrit Code Review about 1 year ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#32 Updated by Gerrit Code Review about 1 year ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#33 Updated by Gerrit Code Review about 1 year ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#34 Updated by Gerrit Code Review about 1 year ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#35 Updated by Susanne Moog 11 months ago

  • Category set to Fluid

#36 Updated by Gerrit Code Review 10 months ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#37 Updated by Gerrit Code Review 10 months ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#38 Updated by Gerrit Code Review 10 months ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#39 Updated by Gerrit Code Review 10 months ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#40 Updated by Gerrit Code Review 10 months ago

Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#41 Updated by Gerrit Code Review 10 months ago

Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#42 Updated by Gerrit Code Review 10 months ago

Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#43 Updated by Gerrit Code Review 10 months ago

Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#44 Updated by Gerrit Code Review 10 months ago

Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#45 Updated by Gerrit Code Review 10 months ago

Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#46 Updated by Gerrit Code Review 10 months ago

Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#47 Updated by Gerrit Code Review 10 months ago

Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#48 Updated by Gerrit Code Review 10 months ago

Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#49 Updated by Gerrit Code Review 10 months ago

Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#50 Updated by Gerrit Code Review 10 months ago

Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#51 Updated by Gerrit Code Review 10 months ago

Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#52 Updated by Gerrit Code Review 10 months ago

Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

#53 Updated by Gerrit Code Review 10 months ago

Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140

Also available in: Atom PDF