Issue Bug Closed

#79662Fluid caches default view paths

Claus Due 02/07/17, 14:19 updated 09/21/25, 01:20

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.

Reviews 4

History 956

Show 531 earlier messages
  1. Gerrit Code Review pushed patch set 1 for master to change 51564 status New Under Review <span data-processor="relativetime" data-value="2017-02-07T14:25:59+00:00" > 02/07/17, 14:25 </span>

  2. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2017-02-08T12:30:11+00:00" > 02/08/17, 12:30 </span>

    Applied in changeset commit:2464bbe006989d3d7c8d741908e95c1905ab93a9.

  3. Gerrit Code Review pushed patch set 1 for master to change 53917 status Resolved Under Review <span data-processor="relativetime" data-value="2017-09-05T17:10:38+00:00" > 09/05/17, 17:10 </span>

  4. Gerrit Code Review pushed patch set 2 for master to change 54140 status Accepted Under Review <span data-processor="relativetime" data-value="2017-09-14T17:24:12+00:00" > 09/14/17, 17:24 </span>

  5. Helmut Hummel commented and changed status Under Review Needs Feedback <span data-processor="relativetime" data-value="2017-09-17T13:02:50+00:00" > 09/17/17, 13:02 </span>

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

  6. Gerrit Code Review pushed patch set 10 for master to change 54140 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2017-09-17T13:49:36+00:00" > 09/17/17, 13:49 </span>

  1. Susanne Moog commented and changed status Under Review Needs Feedback assigned to Claus Due <span data-processor="relativetime" data-value="2019-03-01T19:27:10+00:00" > 03/01/19, 19:27 </span>

    Path has been abandoned. @Claus: Can you check if we still need this concrete issue or whether your potentially different solution renders this one obsolete?

  2. Riccardo De Contardi commented and changed status Needs Feedback New <span data-processor="relativetime" data-value="2019-11-24T16:42:11+00:00" > 11/24/19, 16:42 </span>

    Asked Claus – still present.

    1- It’s still relevant for people who have trouble with default template paths being cached

    2- There are a handful of other issues that relate to it (trouble with template paths and context)

    3- When we finally switch to Fluid 3.0 the template paths and view become deprecated, at which time TYPO3 is likely to adopt a different API than “TemplatePaths” class (and when it does I will be watchful and not allow it to cache path settings because the rest of Fluid isn’t cached anymore)

  3. Christian Kuhn commented and changed status New Closed <span data-processor="relativetime" data-value="2025-09-21T01:20:48+00:00" > 09/21/25, 01:20 </span>

    Hey.

    I’m going to close here for now since it is unlikely this issue will lead to a fresh patch in its current state. I also assume the issue probably does not exist anymore as such since quite a bit of restructuring in this area happen meanwhile: the extbase configuration manager now has a much more straight forward depedency to TS that usually prevents using extbase before TS is loaded. also, the TemplatePaths class in ext:fluid shrinked significantly.

    In case there is still an issue with broken fluid path resolving in some situations, I ask to create a fresh issue with a new how-to-reproduce.