Review main Merged

93809[BUGFIX] Have 'tree' always available in TS condition matcher

Christian Kuhn CR +2 V +2 Easy +27 −9 updated 04/23/26, 12:10

Commit message

IncludeTreeConditionMatcherVisitor only registered the 'tree'
variable when a non-empty rootline was available. DataHandler on
orphaned records in CLI context has none, and conditions like
'[123 in tree.rootLineIds]' then trip Symfony Expression Language
with an unknown-variable SyntaxError.

The patch always exposes 'tree' with sensible empty defaults when
the rootline is absent, so such conditions evaluate to false
instead of erroring out.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2732

Show 57 earlier messages
  1. Christian Kuhn uploaded patch set 1 04/23/26, 00:26

  2. core-ci voted on patch set 1 V +1 04/23/26, 00:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100966

  3. Christian Kuhn updated the commit message in patch set 2 V +1 04/23/26, 00:48

  4. Christian Kuhn commented on patch set 2 04/23/26, 00:55

    would *potentially* be ok with v13, but also a bit risky in edge cases. let's go main & v14 for now.
  5. core-ci voted on patch set 2 V +1 04/23/26, 00:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100968

  6. Garvin Hicking voted on patch set 2 CR +1 V +1 04/23/26, 05:32

  7. Georg Ringer voted on patch set 2 CR +1 V +1 04/23/26, 06:23

  1. Stefan Froemken commented on patch set 2 CR +1 V +1 04/23/26, 06:31

    Wow. Thank you. Just tested again, activated xdebug and yes, it does not runs into any catch block anymore. Wohouu.
  2. Oliver Klee commented on patch set 2 04/23/26, 06:55

    IncludeTreeConditionMatcherVisitor.php:125

    Let's avoid the `empty` here: ```suggestion if ($localRootLine != []) { ```
  3. Oliver Klee voted on patch set 2 V +1 04/23/26, 06:55

  4. Garvin Hicking commented on patch set 2 04/23/26, 07:31

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    That won't work, $localRootLine can also be NULL. So probably: ``` if ($localRootLine !== [] && $localRootLine !== null) ``` Don't know it is possible to be "0" or "" as well.
  5. Oliver Klee commented on patch set 2 04/23/26, 07:38

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    @lolli@schwarzbu.ch What type would be the problem causing the bug? (This isn't clear from the ticket, the commit message of the `empty`.)
  6. Christian Kuhn commented on patch set 2 04/23/26, 08:16

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    ok. After the '?? []' fallback on the preceding line $localRootLine is narrowed to array, null is not reachable. '0' and '' would fail earlier already, different patch and won't kick in in practice since core does not do it. would be separate patch to truly sanitize into this direction let's go '!== []' for explicitness, making intention clear.
  7. Christian Kuhn uploaded patch set 3 CR +1 V +1 04/23/26, 08:16

  8. Christian Kuhn commented on patch set 3 04/23/26, 08:17

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    Done
  9. core-ci voted on patch set 3 V +1 04/23/26, 08:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101003

  10. Oliver Klee voted on patch set 3 V +1 04/23/26, 08:33

  11. Oliver Klee voted on patch set 3 CR +1 04/23/26, 08:33

  12. Georg Ringer voted on patch set 3 CR +1 V +1 04/23/26, 09:40

  13. Christian Kuhn voted on patch set 3 CR +2 V +2 04/23/26, 09:42

  14. Garvin Hicking commented on patch set 3 CR -2 04/23/26, 09:49

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    I would really suggest ``` if ($localRootLine !== [] && $localRootLine !== null) ``` instead, because it does feel like that "null" from $fullRootLine above could fall through when pageId is also not set.....?
  15. Christian Kuhn commented on patch set 3 CR +1 V +1 04/23/26, 09:53

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    ok. please push and note i pushed the backport already which needs an update then.
  16. Garvin Hicking commented on patch set 4 CR +1 V +1 04/23/26, 09:56

    Published edit on patch set 3. Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  17. Garvin Hicking commented on patch set 4 CR +1 V +1 04/23/26, 09:56

    IncludeTreeConditionMatcherVisitor.php:125 Reply

    Done
  18. Oliver Klee voted on patch set 4 CR +1 V +1 04/23/26, 09:57

  19. core-ci voted on patch set 4 V -1 04/23/26, 10:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101019

  20. Garvin Hicking commented on patch set 4 CR 0 V 0 04/23/26, 10:17

    Argh PHPSTan knows best I guess. I yield and revert to patchset 3 -.- Sorry everyone.
  21. Garvin Hicking commented on patch set 5 CR +1 V +1 04/23/26, 10:17

    Published edit on patch set 4.
  22. core-ci voted on patch set 5 V +1 04/23/26, 11:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101023

  23. Oliver Klee voted on patch set 5 CR +1 V +1 04/23/26, 11:07

  24. Garvin Hicking voted on patch set 5 CR +2 V +2 04/23/26, 12:10

  25. Garvin Hicking merged patch set 6 04/23/26, 12:10