#81340TemplatePaths::fillDefaultsByPackageName does not sort paths correctly
Description
The unfortunate series of events which lead to a problem:
- TemplatePaths->fillDefaultsByPackageName($extKey) gets called
- TemplatePaths->fillDefaultSByPackageName() calls getContextSpecificViewConfiguration()
- TemplatePaths->getContextSpecificViewConfiguration() reads TS and returns combined fallback paths and TS-configured paths
- TemplatePaths->fillFromConfigurationArray($resolvedPaths) gets called
- TemplatePaths->fillFromConfigurationArray() calls TemplatePaths->extractPathArrays()
- TemplatePaths->extractPathArrays() calls array_values
Result: when calling fillDefaultsByPackageName() TS paths do not get sorted correctly even though the right setTemplateRootPaths and so on get called. Normally these methods would indeed sort the paths correctly, but the array_values() part (Fluid standalone cares about order, not keys) causes the methods that do perform sorting, to receive an “already sorted” (=values only, numeric zero-index in order TS was declared) which of course does not get sorted further. Final result is that template overrides do not work if View was initialised with this method – which by the way should be the preferred way to initialise View template paths everywhere in TYPO3.
Reviews 5
- TYPO3_8-7 53314[BUGFIX] Add missing frontend context check when fetching view configuration
- main 53309[BUGFIX] Add missing frontend context check when fetching view configuration
- main 53310[FOLLOWUP][BUGFIX] Make TemplatePaths->fillDefaultsByPackageName sort paths
- TYPO3_8-7 53112[BUGFIX] Make TemplatePaths->fillDefaultsByPackageName sort paths
- main 52938[BUGFIX] Make TemplatePaths->fillDefaultsByPackageName sort paths