Review main Merged

77981[TASK] Modernize condition matching

Christian Kuhn CR +2 V +2 Expert +1058 −473 updated 03/01/23, 10:21

Commit message

The TypoScript condition matching and our symfony
expression language handling is a heavily convoluted
mess: The entire API tends to fetch lots of global
state, the classes are complex, hard to understand and
handle, over-abstracted and full of anti-patterns.

The patch aims to mitigate this. The main strategy is
to provide relevant data from within callers directly
instead of fetching globals TYPO3_REQUEST, calling
GeneralUtility::_GP() and GeneralUtility::getIndpEnv().

* For TypoScript 'condition' expression handler usages,
  the frontend/backend related ConditionMatcher classes
  are obsoleted. The IncludeTreeConditionMatcherVisitor
  class within the new TypoScript parser is now the
  construct that prepares TypoScript relevant variables
  to initialize the symfony expression language construct,
  and gets variables actively hand over.

* The default provider now prepares variables from state
  that can be injected, the entire ProviderInterface no
  longer relies on runtime state from globals.

* Access to runtime Request object is streamlined:
  Especially PageTsConfig and UserTsConfig can not rely
  on a given request object since the DataHandler uses
  this a well, which denies systematic usage of request
  related data. This is deprecated.

* The ProviderInterface config handling should still be
  streamlined towards a symfony service provider approach.
  The current solution is kept for now, an @todo is added
  to briefly outline on how this should be changed in v13
  as a breaking change.

* Note this patch avoids the last core usage of
  GeneralUtility::_GP() which will be deprecated with
  another patch. Additionally, a hard to fix call to
  GeneralUtility::getIndpEnv() is avoided.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 52

Show 32 more files

Review log 2541

Show 1016 earlier messages
  1. Christian Kuhn uploaded patch set 1 02/28/23, 12:43

  2. core-ci voted on patch set 1 V -1 02/28/23, 12:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38204

  3. Christian Kuhn uploaded patch set 2 V -1 02/28/23, 12:58

  4. core-ci voted on patch set 2 V -1 02/28/23, 13:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38206

  5. Christian Kuhn uploaded patch set 3 V -1 02/28/23, 13:39

  6. Christian Kuhn uploaded patch set 4 02/28/23, 13:44

  7. core-ci voted on patch set 3 V -1 02/28/23, 13:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38209

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

  9. Christian Kuhn uploaded patch set 5 V -1 02/28/23, 14:13

  10. core-ci voted on patch set 5 V +1 02/28/23, 14:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38214

  11. Stefan Bürk commented on patch set 5 02/28/23, 16:50

    DefaultFunctionsProvider.php:69

    missing return here

    ConditionMatcher.php:74

    We should use `?->`here ...

    ConditionMatcher.php:123

    We could reuse `$request` here (L110)
  12. Christian Kuhn uploaded patch set 6 V +1 02/28/23, 16:51

  13. Christian Kuhn commented on patch set 5 02/28/23, 16:53

    DefaultFunctionsProvider.php:69 Reply

    Done

    ConditionMatcher.php:74 Reply

    Done

    ConditionMatcher.php:123 Reply

    Done
  14. core-ci voted on patch set 6 V +1 02/28/23, 17:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38219

  15. Christian Kuhn uploaded patch set 7 V +1 02/28/23, 17:26

  16. Christian Kuhn uploaded patch set 8 02/28/23, 18:00

  1. Christian Kuhn uploaded patch set 9 02/28/23, 18:03

  2. core-ci voted on patch set 7 V +1 02/28/23, 18:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38220

  3. core-ci voted on patch set 8 V +1 02/28/23, 18:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38222

  4. Christian Kuhn uploaded patch set 10 02/28/23, 18:10

  5. core-ci voted on patch set 9 V +1 02/28/23, 18:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38223

  6. Christian Kuhn uploaded patch set 11 02/28/23, 18:27

  7. core-ci voted on patch set 10 V +1 02/28/23, 18:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38225

  8. Christian Kuhn uploaded patch set 12 02/28/23, 18:54

  9. core-ci voted on patch set 11 V -1 02/28/23, 18:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38228

  10. Christian Kuhn uploaded patch set 13 02/28/23, 18:57

  11. Christian Kuhn uploaded patch set 14 02/28/23, 18:58

  12. core-ci voted on patch set 12 V -1 02/28/23, 19:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38229

  13. core-ci voted on patch set 13 V -1 02/28/23, 19:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38230

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

  15. Stefan Bürk commented on patch set 14 02/28/23, 20:31

    Don't get this ... the `less` is to much here, or ?

    Typo3ConditionFunctionsProvider.php:56

    frontend

    Typo3ConditionFunctionsProvider.php:96

    frontend
  16. Christian Kuhn commented on patch set 14 03/01/23, 07:15

    Reply

    Done

    Typo3ConditionFunctionsProvider.php:56 Reply

    Done

    Typo3ConditionFunctionsProvider.php:96 Reply

    Done
  17. Christian Kuhn uploaded patch set 15 V +1 03/01/23, 07:15

  18. core-ci voted on patch set 15 V +1 03/01/23, 07:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38244

  19. Christian Kuhn uploaded patch set 16 V +1 03/01/23, 07:24

  20. core-ci voted on patch set 16 V +1 03/01/23, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38245

  21. Stefan Bürk voted on patch set 16 CR +1 03/01/23, 09:39

  22. Stefan Bürk voted on patch set 16 V +1 03/01/23, 10:08

  23. Benni Mack voted on patch set 16 V +1 CR +1 03/01/23, 10:10

  24. Christian Kuhn voted on patch set 16 V +2 CR +2 03/01/23, 10:21

  25. Christian Kuhn merged patch set 17 03/01/23, 10:21