Project

General

Profile

Actions

Bug #82196

closed

Can no longer configure diverging templateRootPaths for the view of each plugin in an extension

Added by Thomas Prangenberg almost 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-08-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Up until including TYPO3 7.6 it was possible to configure different templateRootPaths for the views of each plugin within an extension.

For example, with the following configuration ...

plugin.tx_extensionName {
    view {
        templateRootPaths {
           0 = EXT:extensionName/Resources/Private/Templates/
        }
        partialRootPaths {
           0 = EXT:extensionName/Resources/Private/Partials/
        }
        layoutRootPaths {
           0 = EXT:extensionName/Resources/Private/Layouts/
        }
   }
}

plugin.tx_extensionName_pluginName {
    view {
        templateRootPaths {
           0 = EXT:extensionName/Resources/Private/Templates/
           1 = EXT:extensionName/Resources/Private/PluginName/Templates/
        }
        partialRootPaths {
           0 = EXT:extensionName/Resources/Private/PluginName/
           1 = EXT:extensionName/Resources/Private/PluginName/Partials/
        }
        layoutRootPaths {
           0 = EXT:extensionName/Resources/Private/Layouts/
           1 = EXT:extensionName/Resources/Private/PluginName/Layouts/
        }
   }
}

... you would get the plugin "PluginName" to use their own template path and fall back to the templates/partials in the default partial root path.
This is no longer possible due to a change in \TYPO3\CMS\Fluid\View\AbstractTemplateView:

https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/fluid/Classes/View/AbstractTemplateView.php#L79

Before this line, the templateRootPaths are configured correctly. When the templateRootPaths are reinitialized by \TYPO3Fluid\Fluid\View\TemplatePaths::fillDefaultsByPackageName, the configuration within plugin.tx_extensionName.view is used without taking plugin.tx_extensionName_pluginName into account.

Granted, this is a rather special use case, but it was helpful if you were required to change only some of the templates or partials in a plugin and wanted to reuse most of the resources of another plugin. Also, the old behaviour was much more consistent with the overall Typoscript configuration of extbase plugins where you can also, for example, configure different storagePids for each plugin.

I couldn't find a breaking change remark in the changelog so I don't think this is intended?

regards
Thomas


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #82181: Cannot override plugin view.templateRootPaths because of cacheClosed2017-08-23

Actions
Related to TYPO3 Core - Task #82487: Revert TemplatePaths optimizations and regressionsClosedBenni Mack2017-09-14

Actions
Actions

Also available in: Atom PDF