Issue Bug Closed

#82181Cannot override plugin view.templateRootPaths because of cache

RVVN no-lastname-given 08/23/17, 16:48 updated 03/01/19, 19:51

Description

HI,

I put 2 plugins on a page using TypoScript USER_INT objects like this :

page.555 = USER_INT
page.555 {
  userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
  extensionName = Rvvnplugintest
  pluginName = Pi1
  controller = Test
  vendorName = RVVN

  view.templateRootPaths.10 = EXT:rvvnplugintest/Resources/Private/Templates2/
}

page.556 = USER_INT
page.556 {
  userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
  extensionName = Rvvnplugintest
  pluginName = Pi1
  controller = Test
  vendorName = RVVN

  view.templateRootPaths.10 = EXT:rvvnplugintest/Resources/Private/Templates3/
}

The problem is that second plugin instance is not using its configured templates folder (ie “Templates3”) but the one configured for the first plugin instance (ie “Templates2”).

After inspection, I found that the function getContextSpecificViewConfiguration in TemplatePaths class looks for plugin configuration in cache then returns it, if found.

Thus, other instances of the same plugin cannot override templates and always use the first ones from the cache.

Reviews 5