92615[BUGFIX] Order template, partial and layout paths correctly in Extbase context
Commit message
Review
-
Code review CR +2 Done
- Simon Praetorius +2
- Garvin Hicking +1
-
Verified V +2 Done
- Simon Praetorius +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 4
- typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php+29 −12
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Configuration/TypoScript/Basic.typoscript+15 −5
- typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Resources/Private/Templates/Template/BaseTemplate.fluid.htmlnew+14 −0
- typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php20+10 −20
Review log 4050
Show 1925 earlier messages
-
Dmitry Dulepov uploaded patch set 1 02/01/26, 11:58
-
Dmitry Dulepov commented on patch set 1 02/01/26, 12:01
I tried to add tests for this change but there is no existing one and I could not find how to do it. Basically we need to test that this order will be kept: 10 = EXT:anotherext1/Resources/Private/Partials/ 20 = EXT:anotherext2/Resources/Private/Partials/ 100 = EXT:myext/Resources/Private/Partials/ Where "myext" is the extension of the current plugin. Keys do not matter, the order does. -
Dmitry Dulepov uploaded patch set 2 02/01/26, 12:05
-
core-ci voted on patch set 1 V -1 02/01/26, 12:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94759
-
core-ci voted on patch set 2 V -1 02/01/26, 12:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94760
-
Dmitry Dulepov uploaded patch set 3
V -102/01/26, 12:55 -
Garvin Hicking commented on patch set 2 02/01/26, 13:08
Reply
Hey thanks for getting to it. If you check out the CI teat results, these already report issues where due to ordering the expectations are now different. I believe the introduced Helper method currently does no array key Sorting? -
Dmitry Dulepov commented on patch set 3 02/01/26, 13:20
Reply
It does not need to sort because sorting happens deeper in TemplatePaths class. I believe failures happen when there are several paths to the same extension. For example, when the configuration is like this: 10 = EXT:anotherext1/Resources/Private/Partials/ 20 = EXT:anotherext1/Resources/Private/Partials/ 30 = EXT:myext/Resources/Private/PartialsOverride/ 40 = EXT:myext/Resources/Private/Partials/Override/ Before the patch finals paths were: 1 = EXT:myext/Resources/Private/Partials/ 2 = EXT:anotherext1/Resources/Private/Partials/ 3 = EXT:anotherext1/Resources/Private/Partials/ 4 = EXT:myext/Resources/Private/PartialsOverride/ 5 = EXT:myext/Resources/Private/Partials/Override/ Now they are: 1 = EXT:anotherext1/Resources/Private/Partials/ 2 = EXT:anotherext1/Resources/Private/Partials/ 3 = EXT:myext/Resources/Private/PartialsOverride/ 4 = EXT:myext/Resources/Private/Partials/Override/ 5 = EXT:myext/Resources/Private/Partials/ So what is needed here is to insert the default path before any other path to the current extension, like this: 1 = EXT:anotherext1/Resources/Private/Partials/ 2 = EXT:anotherext1/Resources/Private/Partials/ 3 = EXT:myext/Resources/Private/Partials/ 4 = EXT:myext/Resources/Private/PartialsOverride/ 5 = EXT:myext/Resources/Private/Partials/Override/ or to keep previous behaviour if there are paths to the current extension in the array. I am thinking on it. -
core-ci voted on patch set 3 V -1 02/01/26, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94761
-
Dmitry Dulepov commented on patch set 3 02/01/26, 17:48
Reply
Oh, I see what you mean by sorting :) -
Simon Praetorius commented on patch set 3 V -1 02/01/26, 18:35
From my point of view, there are two bugs in this area: One in Extbase and one in Fluid Standalone. Extbase might be fixable for v13 and v14, Fluid will likely be v14 only. I've created a pre-patch (https://review.typo3.org/c/Packages/TYPO3.CMS/+/92619) which adds test cases for both issues. After the pre-patch is merged, the goal of this patch should be to fix the `@todo` in `extbaseSpecificOverrideScenariosDataProvider()`, all other tests should stay green. The current state of this patch does not accomplish that. For Fluid, I've already created a patch that should fix the other three `@todo` (https://github.com/TYPO3/Fluid/pull/1298). -
Dmitry Dulepov commented on patch set 3 02/01/26, 18:41
Reply
The change I am making will fix the issue described in the ticket. Paths will work correctly for both v13 and v14. This is what needed right now in existing customers' projects. Of course, you can fix this is fluid too but v13 needs to be fixed as well. -
Simon Praetorius commented on patch set 3 02/01/26, 20:08
Reply
The failing tests suggest that the current version of this patch breaks existing functionality. -
Dmitry Dulepov commented on patch set 3 02/01/26, 21:13
Reply
Working on it and adding more tests. -
Dmitry Dulepov uploaded patch set 4
V -102/01/26, 21:32 -
core-ci voted on patch set 4 V +1 02/01/26, 22:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94783
-
Garvin Hicking commented on patch set 4 02/02/26, 02:29
Reply
Can you rebase this patch, there are merge conflicts due to changes in the tests merged meanwhile? -
Dmitry Dulepov uploaded patch set 5
V +102/02/26, 08:16 -
Dmitry Dulepov commented on patch set 5 02/02/26, 08:16
Reply
Acknowledged -
core-ci voted on patch set 5 V -1 02/02/26, 08:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94798
-
Dmitry Dulepov uploaded patch set 6
V -102/02/26, 10:00 -
Dmitry Dulepov commented on patch set 6 02/02/26, 10:01
Strange: locally all tests pass but they fail in CI jobs. -
core-ci voted on patch set 6 V -1 02/02/26, 10:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94806
-
Simon Praetorius commented on patch set 6 02/02/26, 11:02
TemplatesPathsTest.php:121I don't think that these can be fixed purely with changes in Extbase, as the tests will also be executed for FLUIDTEMPLATE. This is the part that is covered by the Fluid patch. If your fix addresses this for Extbase, I'd suggest to comment the affected datasets and to duplicate them (for now) to the second data provider, which will only be used for Extbase. -
Dmitry Dulepov uploaded patch set 7
V -102/02/26, 13:41
-
Dmitry Dulepov commented on patch set 7 02/02/26, 13:46
TemplatesPathsTest.php:121Reply@simon@praetorius.me This is already a part of the patch. I also changed logic from adding to the end to prepending only if it is not set explicitly because this would be the most compatible way. -
Simon Praetorius commented on patch set 7 02/02/26, 14:07
TemplatesPathsTest.php:121ReplyI currently don't understand what and why you are moving around in the tests. The more you change the tests and the implementation at the same time, the more it becomes necessary to split out the tests into a pre-patch to make clear what actually changes. That was the reasoning behind my pre-patch, which you now (partly) reverted. -
core-ci voted on patch set 7 V +1 02/02/26, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94819
-
Dmitry Dulepov commented on patch set 7 02/02/26, 14:33
TemplatesPathsTest.php:121ReplyIt could be better if you let me finish the work first before making your changes and adding those todos. I had to partially rework your change because my patch has changed and it needed different tests. Those todos were not valid anymore. Also "defaultOverride" change had incorrect first array member in it and did not work. New tests test two things: 1) when there is no path given, the default path shoild work (there were no such test at all), 2) when there is a default path in the configuration at the highest number, it should be used. The first test covers the missing "before the patch" change and the second test covers the patch. While working on the patch and testing I found that the patch should not append the path to the end as I thought initially because it breaks compatibility. The path should be prepended to the configuration only if it is not already there. This makes it compatible with existing behavior while ensuring that the default path can still override paths with lower numbers. I also updated the description to match the logic. -
Simon Praetorius commented on patch set 7 02/02/26, 15:17
TemplatesPathsTest.php:121Reply> Those todos were not valid anymore. They are for `FLUIDTEMPLATE`. So I would prefer it if those cases would still be present with `@todo`, since they still need fixing. Maybe we can add another data provider just for `FLUIDTEMPLATE`, until the Fluid change is merged and everything behaves the same again?TemplatesPathsTest.php:155Isn't that already covered by `baseRenderingWorksForControllerAsPluginUsageWithoutConfig()`? -
Simon Praetorius commented on patch set 7 02/02/26, 15:20
TemplatesPathsTest.php:121Reply(also, I think the currently removed cases test for a different use case, where the ExtBase defaults aren't involved at all. That's why they could be shared both for Extbase and `FLUIDTEMPLATE`. I think it's worth keeping those.) -
Dmitry Dulepov commented on patch set 7 02/02/26, 15:27
TemplatesPathsTest.php:121ReplyThe fix for fluid is not a part of this patch. So changes for that fix should be separate. Why don't you make a new ticket describing the issuem linking to the PR you made for fluid and adding tests with that ticket number?TemplatesPathsTest.php:155ReplyProbably but the new test does it with all those "pluginConfig" modes, which "baseRenderingWorksForControllerAsPluginUsageWithoutConfig" does not use. -
Simon Praetorius commented on patch set 7 02/02/26, 15:33
TemplatesPathsTest.php:121ReplyI'm not asking you to add the fix to your patch. But it's important to document existing behavior in tests to see the consequences of a bugfix later on. So please don't remove relevant test cases in your patch.TemplatesPathsTest.php:155ReplyOk, then let's remove the test that I added and give the new test a better name, something like `onlyDefaultPaths`. -
Dmitry Dulepov commented on patch set 7 02/02/26, 15:51
TemplatesPathsTest.php:121ReplyI believe that the change should contain only tests that are related to the patch. Why don't you submit your own separate change with more tests for resolving paths? This would be very good and useful I think. You can even name it accordingly: "Add more tests for resolving paths to layouts, partials and templates" or so. I believe in grouping related changes, it makes easier to analyze changes in future.TemplatesPathsTest.php:155ReplyWhat test do you mean? I think "defaultReordered" is a good and relevant test for this patch. -
Simon Praetorius commented on patch set 7 02/02/26, 15:58
TemplatesPathsTest.php:121Reply> Why don't you submit your own separate change with more tests for resolving paths? That's exactly what I did, and it went in before your changes. So now you can't just remove test cases and todos that are still relevant.TemplatesPathsTest.php:155Replyremove `baseRenderingWorksForControllerAsPluginUsageWithoutConfig()` and rename your `haveDefaultPath`. -
Dmitry Dulepov commented on patch set 7 02/02/26, 16:42
TemplatesPathsTest.php:121ReplyI see. Let me run all tests (including yours again) and see if they still work. -
Dmitry Dulepov uploaded patch set 8
V +102/02/26, 16:56 -
Dmitry Dulepov commented on patch set 8 02/02/26, 16:57
TemplatesPathsTest.php:121ReplyI restored them. -
core-ci voted on patch set 8 V +1 02/02/26, 17:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94830
-
Simon Praetorius uploaded patch set 9
V +102/02/26, 18:45 -
Simon Praetorius commented on patch set 9 CR +1 V +1 02/02/26, 18:46
TemplatesPathsTest.php:155ReplyDone -
core-ci voted on patch set 9 V +1 02/02/26, 18:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94846
-
Simon Praetorius uploaded patch set 10
CR +1V +102/02/26, 19:04 -
Simon Praetorius voted on patch set 10 CR +1 V +1 02/02/26, 19:04
-
core-ci voted on patch set 10 V +1 02/02/26, 19:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94848
-
Simon Praetorius commented on patch set 10 02/02/26, 19:18
I just validated manually that this worked in TYPO3 v12 and stopped working in v13, so the backport is valid imho.TemplatesPathsTest.php:274Just for reference: This is now covered by `onlyDefaultPaths` above. -
Garvin Hicking voted on patch set 10 CR +1 V +1 02/03/26, 08:52
-
Dmitry Dulepov commented on patch set 10 02/03/26, 09:00
TemplatesPathsTest.php:274ReplyThank you! 👍 -
Simon Praetorius voted on patch set 10 CR +2 V +2 02/03/26, 09:19
-
Simon Praetorius merged patch set 11 02/03/26, 09:20