48279[BUGFIX] Re-Establish correct Fluid path ordering
Commit message
Review
-
Code review CR +2
- Helmut Hummel +2
- Sascha Egerer +1
- Nicole Hummel +1
-
Verified V +2
- Helmut Hummel +2
- Sascha Egerer +1
- Nicole Hummel +1
- TYPO3com +1 CI
Issues 1
Files 4
Review log 6983
Show 5058 earlier messages
-
Claus Due uploaded patch set 1 05/24/16, 14:13
-
Stefan Froemken commented on patch set 1 CR +1 V +1 05/24/16, 14:27
krsort, krsort, krsort -
Claus Due uploaded patch set 2 05/24/16, 14:28
-
Stefan Froemken commented on patch set 2 CR +1 V +1 05/24/16, 14:33
Yeah. That works pretty well. Thank you. -
Claus Due uploaded patch set 3 05/24/16, 14:58
-
Claus Due commented on patch set 3 05/24/16, 14:58
Updated to solution described in https://github.com/TYPO3Fluid/Fluid/pull/105 -
Claus Due commented on patch set 3 05/24/16, 14:59
...and I really am sorry about the confusion, Stefan! I know how demotivating something like that can be so please accept my apology for that. -
Claus Due uploaded patch set 4 05/24/16, 15:01
-
Claus Due commented on patch set 3 05/24/16, 15:02
Last push from me for now - but DO NOT MERGE THIS until we have a new TYPO3Fluid release so set as dependency for TYPO3. The "ksort" will not depend on the changed resolving behavior in https://github.com/TYPO3Fluid/Fluid/pull/105 -
Helmut Hummel commented on patch set 4 CR -1 05/24/16, 17:42
We should decide whether we want to do this in general in TemplatePaths, or in calling code. With this change we're doing it both, as \TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getViewProperty() also does sorting by key I had a patch ready, which deals with the sorting in the StandaloneView, which would have been in line with the current code -
Claus Due commented on patch set 4 05/24/16, 18:03
Just to explain why I put this in TemplatePaths instead of the calling code or StandaloneView (I assume you used the delegating methods on View to set paths?): It is possible to do: $this->renderingContext->getTemplatePaths()->setPartialRootPaths($paths); From pretty much anywhere in the code (including inside ViewHelpers, which was also documented as a theoretical use case). The only two methods that would allow this to function are: * Sorting in the getter method * Sorting in the setter method And for performance and debugging ability I chose to use the setter (so the mutated state of the TemplatePaths object can be inspected). With this you are completely right - we can remove some krsorts in other places! We could also implement krsort before all calling code sets paths but I think that might be harder to document than being able to categorically say: "any template paths you set in TYPO3 CMS Views regardless of source will be sorted with keys as priority, with highest priority paths being checked first". Hopefully I'm not missing something important in this logic... -
Wolfgang Wagner uploaded patch set 5 06/16/16, 21:39
-
Wolfgang Wagner commented on patch set 5 06/16/16, 21:41
Please ignore/delete the upload from me, I'm not very familiar with this tool and clicked the wrong button! Sorry! -
Wouter Wolters commented on patch set 6 06/16/16, 21:43
Published edit on patch set 5. -
Wolfgang Wagner voted on patch set 5 V -1 06/16/16, 21:46
-
Nicole Hummel commented on patch set 6 06/17/16, 09:18
TemplatePaths.php:177Can we rely on numeric arrays here or do we have to take care about stdWrap? The documentation says that stdWrap can be used. Is it resolved in this place already? -
Claus Due commented on patch set 6 06/18/16, 14:20
> Can we rely on numeric arrays here or do we have to take care about stdWrap? Relying on alpha-numeric should be fine as long as people know what to expect! Highest value first. > The documentation says that stdWrap can be used. Is it resolved in this place already? In TemplatePaths - no, and I don't agree it should. Though, FLUIDTEMPLATE cObject does that currently before passing the paths along so speaking of FLUIDTEMPLATE the docs are correct. -
Daniel Goerz commented on patch set 6 07/01/16, 08:51
ping. Is this mergeable for 8.2? -
Daniel Goerz commented on patch set 6 07/01/16, 08:53
For reference: https://review.typo3.org/#/c/48469 -
Helmut Hummel commented on patch set 6 CR -1 07/01/16, 10:20
imho this change misses some tests to prove this works properly. (me missed them before unfortunately) additionally, there is still template sorting in \TYPO3\CMS\Extbase\Mvc\Controller\ActionController::getViewProperty(), which should be also removed (which could break some tests which need to be fixed then) -
Claus Due uploaded patch set 7 07/10/16, 11:37
-
Claus Due commented on patch set 7 07/10/16, 11:38
Now with unit test. -
TYPO3com voted on patch set 7 V -1 07/10/16, 11:41 Completed build in 03m 26s on Sun, 10 Jul, 01:41 PM Test Summary: 18428 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-678
-
Claus Due commented on patch set 7 07/10/16, 11:43
@Helmut I'd like to address the sorting in controller in a different patch. Letting the (redundant) sorting stay there should not hurt since Fluid already respects and preserves indices. Sorting would happen twice but order would not change. -
Helmut Hummel commented on patch set 7 07/11/16, 10:59
> Now with unit test. Forgot to add them to the commit? -
Helmut Hummel commented on patch set 7 CR -1 07/11/16, 11:08
> I'd like to address the sorting in controller in a different patch I think this is wrong. It is wrong, because the sorting proposed here is different than the sorting done in the controller. The controller uses ArrayUtility::sortArrayWithIntegerKeys(), which skips sorting in case there are non integer keys in the array. Additionally, the result is then reversed. The sorting here is a plain ksort (or krsort) We should imho first decide on the wanted behavior across the entire application before we start fixing things in one area. To be honest, I'm currently a bit lost and would like to see functional rendering tests to be sure we're doing the right thing hereTemplatePaths.php:165In patch set 6 you had krsort, now you have ksort. What is correct and why? -
Helmut Hummel commented on patch set 7 07/11/16, 20:59
I build an extension to outline all outstanding issues with template path resolving: https://travis-ci.org/helhum/fluid_test As you see, all tests pass in 7.6, and a lot of them don't in master. Not sure yet how many tests this change here fixes, I will push an update to a TYPO3 fork on Github and let Travis run the test against this change -
Claus Due uploaded patch set 8 07/11/16, 21:01
-
Claus Due commented on patch set 8 07/11/16, 21:04
Now with unit test file (man I wish git commit -a --amend would add new files...) > As you see, all tests pass in 7.6, and a lot of them don't in master. Fluid is required in dev-master (due to https://github.com/TYPO3Fluid/Fluid/commit/6e527daff81c69e32ea71893084dae508d4360f1) which doesn't appear to be pulled by your test extension? -
TYPO3com voted on patch set 8 V -1 07/11/16, 21:07 Completed build in 06m 12s on Mon, 11 Jul, 11:07 PM Test Summary: 18457 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-799
-
Claus Due commented on patch set 8 07/11/16, 21:08
Missed a few comments: > The controller uses ArrayUtility::sortArrayWithIntegerKeys(), which skips sorting in case there are non integer keys in the array. I'm okay with using that method as well (for consistency) but would like to point out that using alphanumeric characters as index is supported by Fluid itself (and it doesn't seem right that in CMS this causes no sorting). > Additionally, the result is then reversed. True, but Fluid needs the array in the original order and will iterate from the bottom up. See https://github.com/TYPO3Fluid/Fluid/commit/6e527daff81c69e32ea71893084dae508d4360f1#diff-7892b10d8d052eaed47516c29d922827R663 -
Helmut Hummel uploaded patch set 9 07/11/16, 21:30
-
Helmut Hummel commented on patch set 8 07/11/16, 21:32
TemplatePathsTest.php:38equals doesn't test anything, as the order in the array is not taken into accountTemplatePathsTest.php:54this is the wrong expectation, isn't it? You just wrote Fluid expects them in order, not reversed order -
TYPO3com voted on patch set 9 V -1 07/11/16, 21:34 Completed build in 03m 23s on Mon, 11 Jul, 11:34 PM Test Summary: 18457 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-800
-
Helmut Hummel commented on patch set 9 CR -1 V -1 07/11/16, 21:34
These are the failing tests in current master without this patch: https://travis-ci.org/helhum/fluid_test/jobs/143991644#L371 Still a lot of failing tests with this change: https://travis-ci.org/typo3-ci/TYPO3v4-Core/jobs/144004366#L486 -
Helmut Hummel uploaded patch set 10 07/11/16, 21:36
-
Helmut Hummel voted on patch set 10 CR -1 V -1 07/11/16, 21:36
-
TYPO3com voted on patch set 10 V +1 07/11/16, 21:39 Completed build in 03m 26s on Mon, 11 Jul, 11:39 PM Test Summary: 18462 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-801
-
Claus Due commented on patch set 8 07/11/16, 22:00
TemplatePathsTest.php:38ReplyNoted, thanks, was not aware that it disregarded order.TemplatePathsTest.php:54ReplyFluid will not do any sorting, is what I meant. It will iterate the array reverse but will not sort it. So in this case we do want to provide Fluid with the highest index coming last. -
Helmut Hummel uploaded patch set 11 07/11/16, 22:59
-
TYPO3com voted on patch set 11 V +1 07/11/16, 23:02 Completed build in 03m 31s on Tue, 12 Jul, 01:02 AM Test Summary: 18462 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-802
-
Helmut Hummel commented on patch set 11 CR -2 07/12/16, 00:14
There are more thing broken. Also in current Fluid master :-/ -
Helmut Hummel uploaded patch set 12 07/12/16, 00:16
-
TYPO3com voted on patch set 12 V +1 07/12/16, 00:20 Completed build in 03m 39s on Tue, 12 Jul, 02:20 AM Test Summary: 18462 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-803
-
Helmut Hummel commented on patch set 12 V +1 07/12/16, 00:21
This change makes all tests green https://travis-ci.org/typo3-ci/TYPO3v4-Core/jobs/144037606#L502 with a patched version of Fluid https://github.com/TYPO3Fluid/Fluid/commit/b35c975f91e2a4fa8d66200ced7cb317e0a61560 (which in turn fails some test on that side) This cannot be merged until we have a stable and released Fluid again.AbstractTemplateView.php:81I have no idea what this was meant for, but it broke the template path ordering (which was established before this call) completely again -
Claus Due commented on patch set 12 07/12/16, 09:10
Now it's my turn to be a little lost :) In https://github.com/TYPO3Fluid/Fluid/commit/b35c975f91e2a4fa8d66200ced7cb317e0a61560 I can't tell why you reverted the dynamic layout feature? It should be completely unrelated to this file resolving. Also, there doesn't seem to be any functional difference between the old and new code that handles resolving files, except for the old code using early return? The exception is still caught, the candidates are still checked in the same order, and so on. I may need a bit of explanation ;)AbstractTemplateView.php:81ReplyWhen fillDefaultsByPackageName is called, it creates the expected template root path defaults and inserts those (so theoretically you wouldn't ever need to define any *default* template paths when operating with a controller context). If this gets called *after* the sorted paths have been delivered then that's unexpected and we would have to avoid that. Ways to avoid it: 1) In TemplatePaths check if paths are currently set before allowing either of the fill****** methods to clear paths. 2) Where setControllerContext is called, move the order around so it gets called first and any set*******RootPaths method are called after that. I'm thinking 2) is our bet since it is quite unexpected that the context gets set *after* the template paths (given that the context actually has an influence on the template paths). -
Helmut Hummel commented on patch set 12 07/12/16, 10:01
> I can't tell why you reverted the dynamic layout feature? I wanted to have one case with all tests working. I achieved this only with the layout feature reverted. This merged feature introduced several bug with cached templates, which I demonstrate here: https://github.com/TYPO3Fluid/Fluid/pull/117 It is only roughly related. It is related, because we need an upstream Fluid fix to get everything working in TYPO3 and the upstream Fluid currently had a major bug (assuming we will update to master) -
Helmut Hummel commented on patch set 12 07/12/16, 10:06
> Also, there doesn't seem to be any functional difference between the old and new code that handles resolving files, except for the old code using early return? Well. please look closely. try { return doStuff(1); } catch (\Exception $e) { return doStuff(2); } catch (\Exception $e) { return null; } Such a construct does not work, when an exception is thrown in doStuff(2); It may be indeed the case, that this wasn't the problem I faced, but nevertheless this code needed a fix. -
Helmut Hummel commented on patch set 12 V -1 07/12/16, 14:28
Hm, with this change (and fluid master applied) the extension manager is broken :-/ More tests needed … -
Helmut Hummel commented on patch set 12 CR -1 07/28/16, 09:26
In the next weeks I won't have time to work on this. current state is that master typo3fluid seems ok (functional tests pass), but misses a tagged version. with typo3fluid master and latest patch set here, EM was broken in my tests -
Sascha Egerer commented on patch set 12 CR +1 09/16/16, 21:29
+1 if https://github.com/TYPO3Fluid/Fluid/pull/149 gets mergedAbstractTemplateView.php:81ReplyThat patch will fix the issue but i'm not sure if that is a good solution. https://github.com/TYPO3Fluid/Fluid/pull/149 It works for me at least -
Helmut Hummel uploaded patch set 13 09/16/16, 21:42
-
TYPO3com voted on patch set 13 V -1 09/16/16, 21:45 Completed build in 03m 13s on Fri, 16 Sep, 11:45 PM Test Summary: 18523 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3106
-
Helmut Hummel uploaded patch set 14 09/16/16, 21:47
-
TYPO3com voted on patch set 14 V +1 09/16/16, 21:51 Completed build in 03m 38s on Fri, 16 Sep, 11:51 PM Test Summary: 18523 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3107
-
Helmut Hummel commented on patch set 14 CR -1 V -1 09/16/16, 21:59
now my Fluid rendering tests are failing again :-/ -
Sascha Egerer commented on patch set 14 CR +1 V +1 09/16/16, 22:03
I can't find any issue on my machine. What's the problem? -
Helmut Hummel uploaded patch set 15 09/16/16, 22:58
-
Helmut Hummel commented on patch set 15 CR -1 V +1 09/16/16, 22:59
tests now work, but code is pretty non straightforward -
TYPO3com voted on patch set 15 V -1 09/16/16, 23:02 Completed build in 03m 33s on Sat, 17 Sep, 01:02 AM Test Summary: 12 of 18523 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3108
-
Markus Klein commented on patch set 15 09/16/16, 23:18
addsIMO this patch is WIP until the mentioned PRs are merged. Then this text shall be removed here too. -
Helmut Hummel commented on patch set 15 09/16/16, 23:46
ahh, sorry. I was under the impression Fluid standalone version was already updated, but it was not. This makes things a bi easier. New patch with updated Fluid dependencies incoming -
Nicole Hummel uploaded patch set 16 09/16/16, 23:48
-
TYPO3com voted on patch set 16 V +1 09/16/16, 23:52 Completed build in 03m 51s on Sat, 17 Sep, 01:52 AM Test Summary: 18523 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3109
-
Nicole Hummel uploaded patch set 17 09/17/16, 00:00
-
Helmut Hummel voted on patch set 17 CR +1 V +1 09/17/16, 00:03
-
TYPO3com voted on patch set 17 V +1 09/17/16, 00:04 Completed build in 03m 34s on Sat, 17 Sep, 02:04 AM Test Summary: 18523 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3110
-
Helmut Hummel commented on patch set 17 09/17/16, 00:04
ok. that should be it. easy, right? ;) -
Claus Due commented on patch set 17 CR -1 09/17/16, 00:41
Normally we upgrade the Fluid dependency separately and fit it with a cover message that includes a list of changes: https://review.typo3.org/49626 https://review.typo3.org/48069 https://review.typo3.org/47279 etc. I would very much prefer if we keep doing that ;) -
Helmut Hummel commented on patch set 17 09/17/16, 00:45
> Normally we upgrade the Fluid dependency separately and fit it with a cover message that includes a list of changes For me this change here is a logical unit: fixing bugs in our code that depend on fixes in third party code bundled together in one fix. If a (even more) broken state in this area after the Fluid dependency update is preferred, I don't really mind, go ahead and change it. -
Helmut Hummel commented on patch set 17 09/17/16, 00:47
I understand, that fluid is a key part of TYPO3. nevertheless duplicating change logs does not make sense to me. But I bow to majority here -
Helmut Hummel updated the commit message in patch set 18 09/17/16, 00:52
-
Nicole Hummel voted on patch set 18 CR +1 V +1 09/17/16, 00:54
-
TYPO3com voted on patch set 18 V +1 09/17/16, 00:55 Completed build in 03m 21s on Sat, 17 Sep, 02:55 AM Test Summary: 18523 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3111
-
Sascha Egerer commented on patch set 18 CR -1 09/17/16, 12:28
Will add more tests -
Sascha Egerer uploaded patch set 19 09/17/16, 12:39
-
Sascha Egerer voted on patch set 19 CR +1 V +1 09/17/16, 12:39
-
TYPO3com voted on patch set 19 V +1 09/17/16, 12:43 Completed build in 03m 30s on Sat, 17 Sep, 02:43 PM Test Summary: 18529 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3113
-
Nicole Hummel voted on patch set 19 CR +1 V +1 09/17/16, 18:16
-
Helmut Hummel voted on patch set 19 CR +2 V +2 09/17/16, 18:16
-
Gerrit merged patch set 19 09/17/16, 18:17
-
Benni Mack commented on patch set 20 09/18/16, 18:59
thanks to everybody involved for helping getting this finished! -
TYPO3com commented on patch set 3 03/22/17, 15:33 Completed build in 07s on Wed, 22 Mar, 04:33 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9439