Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Classes/Utility/TemplateUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ public static function getTemplateFolders(string $part = 'template', $returnAllP
$configuration = self::getConfigurationManager()
->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'femanager');
if (!empty($configuration['view'][$part . 'RootPaths'] ?? '')) {
$templatePaths = $configuration['view'][$part . 'RootPaths'] ?? '';
$templatePaths = array_values($templatePaths);
// typoscript keys should be sorted here, but aren't!!
$unsortedTemplatePaths = $configuration['view'][$part . 'RootPaths'] ?? '';
$arrayKeys = array_keys($unsortedTemplatePaths);
sort($arrayKeys);
foreach ($arrayKeys as $key) {
$templatePaths[] = $unsortedTemplatePaths[$key];
}
}

if ($returnAllPaths || $templatePaths === []) {
Expand All @@ -60,7 +65,8 @@ public static function getTemplateFolders(string $part = 'template', $returnAllP

$templatePaths[] = 'EXT:femanager/Resources/Private/' . ucfirst($part) . 's/';
}

// this breaks the configured order of paths by removing higher
// priority paths if they have lower priority duplicates
$templatePaths = array_unique($templatePaths);
$absolutePaths = [];
foreach ($templatePaths as $templatePath) {
Expand Down