Review main Merged

82560[BUGFIX] Reverse rootline for PageLayoutResolver calls

Dimitri König CR +2 V +2 Hard +554 −3 updated 02/06/24, 11:52

Commit message

There have been quite a lot of patches around the pagelayout
condition, which was introduced in early TYPO3 v11. It was
broken in the beginning and got fixed with #98044.
Soon after, a major refactoring of the ConditionMatcher
has been applied with #100047, which re-introduced bugs
regarding the pagelayout TypoScript condition. These have
partially fixed with #100764 and #100921.

The affected code is a bit messy due to a weird sorted
array returned by the 'rootline' methods and classes,
which we can't resolve right now.

The fix itself revolves a last issue by reversing the
rootline again. This was already done in the old backend
ConditionMatcher. The frontend ConditionMatcher received
the fullRootline, which is already reversed (deepest first).

With the introduction of IncludeTreeConditionMatcherVisitor
this has been unified, but the array_reverse was forgotten.

In addition, the fullRootline from the frontend controller
and BackendUtility::getPagesTSconfig() calls are sorted with
`ksort` before passed over, meaning we always receive a
top-down (root-first) rootline. Hence, the array_reverse is
a viable fix for both backend and frontend.

The patch covers BE pageTS, FE TypoScript and FE getData
with tests to cover the situation once and for all.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Christian Kuhn +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 6

Files 29

Show 9 more files

Review log 3243

Show 1118 earlier messages
  1. Dimitri König uploaded patch set 1 01/22/24, 21:24

  2. core-ci voted on patch set 1 V -1 01/22/24, 21:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51951

  3. Dimitri König uploaded patch set 2 V -1 01/22/24, 21:33

  4. core-ci voted on patch set 2 V -1 01/22/24, 21:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51952

  5. Dimitri König uploaded patch set 3 V -1 01/22/24, 21:43

  6. core-ci voted on patch set 3 V +1 01/22/24, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51953

  7. Nikita Hovratov commented on patch set 3 CR -1 01/24/24, 21:30

    See comment in issue please.
  8. Nikita Hovratov commented on patch set 3 01/27/24, 19:25

    We already have a patch for that pending: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81595 So first let's coordinate, which one of them we want to pursue and close one of them. Secondly, we need real frontend Tests for that. This would've avoided the regression in the first place. Also, we must ensure the condition still works in the backend.
  9. Nikita Hovratov uploaded patch set 4 CR -1 V +1 01/28/24, 00:59

  10. core-ci voted on patch set 4 V -1 01/28/24, 01:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52336

  11. Nikita Hovratov uploaded patch set 5 V -1 01/28/24, 01:09

  12. core-ci voted on patch set 5 V +1 01/28/24, 01:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52338

  13. Nikita Hovratov uploaded patch set 6 V +1 01/28/24, 02:02

  14. core-ci voted on patch set 6 V +1 01/28/24, 02:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52339

  15. Nikita Hovratov uploaded patch set 7 V +1 01/28/24, 02:41

  16. core-ci voted on patch set 7 V +1 01/28/24, 02:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52341

  17. Nikita Hovratov commented on patch set 7 V +1 01/28/24, 02:54

    Added frontend and backend tests. Seems like a legit fix. Also, before the related patch there was an array_reverse in backend ConditionMatcher as well.
  1. Nikita Hovratov uploaded patch set 8 V +1 01/28/24, 17:51

  2. Nikita Hovratov updated the commit message in patch set 9 01/28/24, 17:53

  3. core-ci voted on patch set 8 V +1 01/28/24, 17:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52376

  4. core-ci voted on patch set 9 V +1 01/28/24, 17:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52377

  5. Nikita Hovratov voted on patch set 9 CR +1 V +1 01/28/24, 20:34

  6. Christian Kuhn commented on patch set 9 CR -1 01/28/24, 21:44

    Yeah. It's possible I've mixed this up in v12 when I refactored the condition stuff. I'll have a detailed look at this patch after 13.0 release and I hope it's ok to add a -1 for now to give me a couple of days for some review before a merge is triggered here.
  7. Christian Kuhn commented on patch set 9 02/05/24, 12:48

    this looks good and the functional tests are gold to nail this once and for all. i'll move them around a bit, though, hope this is ok. i'll also add some additional notes in the code - all this resorting mess stems from the fact that RootlineUtility returns this weird sorted rootline in the first place. We should work on this when we work on RootlineUtility to reduce all that brain-melting resorting everywhere.
  8. Christian Kuhn commented on patch set 9 02/05/24, 13:56

    note for FE condition tests i'll use the test class name 'FrontendTypoScriptFactory' prefix, since that class will be created with further TSFE refactoring very soon.
  9. Christian Kuhn uploaded patch set 10 CR +1 V +1 02/05/24, 14:17

  10. core-ci voted on patch set 10 V -1 02/05/24, 14:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52733

  11. Christian Kuhn uploaded patch set 11 V -1 02/05/24, 14:47

  12. core-ci voted on patch set 11 V +1 02/05/24, 14:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52737

  13. Christian Kuhn voted on patch set 11 CR +1 V +1 02/05/24, 14:54

  14. Stefan Bürk voted on patch set 11 CR -1 02/05/24, 15:34

  15. Nikita Hovratov voted on patch set 11 CR +1 V +1 02/05/24, 15:35

  16. Stefan Bürk voted on patch set 11 CR +2 V +2 02/05/24, 15:45

  17. Oliver Klee voted on patch set 11 V +1 02/05/24, 15:46

  18. Stefan Bürk commented on patch set 11 V 0 CR -1 02/05/24, 16:42

    backport nifty / red. have to investigate this first & talk with lolli.
  19. Nikita Hovratov commented on patch set 11 02/05/24, 17:14

    Reply

    Looks like in v12 `page = PAGE` is not enough and will trigger `The page is not configured! [type=0][page].`. The failing test case is the only one, which doesn't meet the condition and hence doesn't set page.10.
  20. Stefan Bürk commented on patch set 11 02/05/24, 17:28

    Reply

    Yeah - the handling code has changed in the typoscript preparation. I'd like to discuss this first with lolli - if that is a bug in v12 or in the changed v13 handling. Root cause is that there will not be a `page.` in the generated setupAst if only a `page = PAGE is in the typoscript`. Therefore, leaving this change unmerged until the related but not this change responsible is solved. And therefore the -1 for now.
  21. Christian Kuhn commented on patch set 11 02/05/24, 22:01

    Reply

    looks as if the condition does not kick in in v12. did not finish debugging, yet, though - smells like a real bug found by the functionals.
  22. Stefan Bürk commented on patch set 11 02/05/24, 23:47

    Reply

    ping me i debugged it - just not sure about the solution @lolli. let's talk about that tomorrow
  23. Christian Kuhn commented on patch set 11 02/06/24, 11:46

    Reply

    This is a minor change in behavior from the TS refactoring in v13: v13 accepts an empty PAGE object (no children), while v12 throws on this. We decided to keep the 'empty PAGE' scenario in v13 as is, so this v12 test got a minor adaption to set page.typeNum = 0. Note the affected test has a condition that is *not* supossed to validate to true (assertStringNotConains()...).
  24. Stefan Bürk voted on patch set 11 CR +2 V +2 02/06/24, 11:52

  25. Stefan Bürk merged patch set 12 02/06/24, 11:52