femanager icon indicating copy to clipboard operation
femanager copied to clipboard

TemplateUtility:getTemplateFolders() mixes up paths

Open webloft opened this issue 6 years ago • 3 comments

Do not use array_values() which will not preverse any ordering of the paths. The paths returned by Extbase may be in different order, depending on typoscript execution.

A ksort($templatePaths); before array_values() also may fix the issue - but I will not make a pull request since I do not how your implementation logic. getTemplatePath() says "Only the first existing file/path will be returned." but in fact it will select the last element through the end() call.

webloft avatar May 30 '18 14:05 webloft

@webloft please specify the file / line you are referring

sbusemann avatar Jul 14 '18 09:07 sbusemann

femanager/Classes/Utility/TemplateUtility.php:49 and may be other occurrences of array_values(). femanager/Classes/Utility/TemplateUtility.php:80 select last element with calling end()

Same problem in powermail.

webloft avatar Jul 16 '18 11:07 webloft

A simple ksort does not solve the issue. At the moment I rate this as a minor issue, as no one else reported it since then.

sbusemann avatar Oct 13 '21 20:10 sbusemann