{"action":"created","issue":{"url":"https://api.github.com/repos/FluidTYPO3/flux/issues/779","labels_url":"https://api.github.com/repos/FluidTYPO3/flux/issues/779/labels{/name}","comments_url":"https://api.github.com/repos/FluidTYPO3/flux/issues/779/comments","events_url":"https://api.github.com/repos/FluidTYPO3/flux/issues/779/events","html_url":"https://github.com/FluidTYPO3/flux/pull/779","id":61153173,"number":779,"title":"[BUGFIX] Wrong sort order of  all RootPaths","user":{"login":"monosize","id":1583746,"avatar_url":"https://avatars.githubusercontent.com/u/1583746?v=3","gravatar_id":"","url":"https://api.github.com/users/monosize","html_url":"https://github.com/monosize","followers_url":"https://api.github.com/users/monosize/followers","following_url":"https://api.github.com/users/monosize/following{/other_user}","gists_url":"https://api.github.com/users/monosize/gists{/gist_id}","starred_url":"https://api.github.com/users/monosize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monosize/subscriptions","organizations_url":"https://api.github.com/users/monosize/orgs","repos_url":"https://api.github.com/users/monosize/repos","events_url":"https://api.github.com/users/monosize/events{/privacy}","received_events_url":"https://api.github.com/users/monosize/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-13T17:37:45Z","updated_at":"2015-03-14T00:17:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/FluidTYPO3/flux/pulls/779","html_url":"https://github.com/FluidTYPO3/flux/pull/779","diff_url":"https://github.com/FluidTYPO3/flux/pull/779.diff","patch_url":"https://github.com/FluidTYPO3/flux/pull/779.patch"},"body":"Here is the Problem\r\nWrong sort order when using more then one RootPath.\r\n\r\n### Example\r\n```typoscript\r\nview {\r\n  templateRootPaths {\r\n    10 = EXT:a/Resources/Private/Templates/\r\n    20 = EXT:b/Resources/Private/Templates/\r\n  }\r\n ...\r\n}\r\n```\r\n\r\nIn the method `fillFromTypoScriptArray` \r\n\r\nArray templateRootPaths before krsort \r\n0 = EXT:a/Resources/Private/Templates/\r\n1 = EXT:b/Resources/Private/Templates/\r\n\r\nArray templateRootPaths after krsort \r\n1 = EXT:b/Resources/Private/Templates/\r\n0 = EXT:a/Resources/Private/Templates/\r\n\r\nArray templateRootPaths after `array_values(array_unique( ...))` \r\n0 = EXT:b/Resources/Private/Templates/\r\n1 = EXT:a/Resources/Private/Templates/\r\n\r\nLater in the method `resolveTemplateFileForControllerAndActionAndFormat` \r\n```php\r\nforeach (array_reverse($this->templateRootPaths) as $templateRootPath) { ...}\r\n````\r\nwith array_revers now the first used Path is\r\n1 = EXT:a/Resources/Private/Templates/ \r\nThats wrong!\r\n\r\nIn this pull request krsort is removed and a ksort is inserted in the method `extractPathArrays`\r\nnow the rootPath with the higher numeric key is used.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FluidTYPO3/flux/issues/comments/79562429","html_url":"https://github.com/FluidTYPO3/flux/pull/779#issuecomment-79562429","issue_url":"https://api.github.com/repos/FluidTYPO3/flux/issues/779","id":79562429,"user":{"login":"NamelessCoder","id":2228052,"avatar_url":"https://avatars.githubusercontent.com/u/2228052?v=3","gravatar_id":"","url":"https://api.github.com/users/NamelessCoder","html_url":"https://github.com/NamelessCoder","followers_url":"https://api.github.com/users/NamelessCoder/followers","following_url":"https://api.github.com/users/NamelessCoder/following{/other_user}","gists_url":"https://api.github.com/users/NamelessCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/NamelessCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NamelessCoder/subscriptions","organizations_url":"https://api.github.com/users/NamelessCoder/orgs","repos_url":"https://api.github.com/users/NamelessCoder/repos","events_url":"https://api.github.com/users/NamelessCoder/events{/privacy}","received_events_url":"https://api.github.com/users/NamelessCoder/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T00:17:13Z","updated_at":"2015-03-14T00:17:13Z","body":"@monosize sorry to hijack the fix like this but it turns out the problem was a little deeper. There was one last thing to be done before the behavior was completely in sync with what you expect when you set view paths in (for example) a standard Extbase plugin.\r\n\r\nSee the commit for explanation - the TL;DR is that in vanilla Extbase, `getViewProperty` on `ActionController` will actually sort these. Flux doesn't use this method and needs the paths sorted also when using them outside of controllers - so 2+2, Flux TemplatePaths now sorts like `ActionController` would, plus support for `overlays.`."}}