Review main Merged

77477[TASK] Avoid last usage of GU::_GPmerged() and deprecate

Anja Leichsenring CR +2 V +2 Normal +152 −37 updated 01/18/23, 20:39

Commit message

After years of refactoring, TYPO3 core finally removes
a last usage of GeneralUtility::_GPmerged() which is
an anti-pattern method, since it accesses $_GET
and $_POST instead of retrieving things from
PSR-7 ServerRequestInterface $request.

Review

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

Issues 1

Files 6

Review log 1923

  1. Anja Leichsenring uploaded patch set 1 01/18/23, 15:40

  2. Christian Kuhn commented on patch set 1 CR -1 01/18/23, 15:45

    on it.

    Deprecation-99615-GeneralUtilityGPMerged.rst:42

    let's add a code example here. there should be plenty in the core and it should be easy to give a one-liner example that is php warning free for people to easily copy&paste as boilerplate.
  3. Christian Kuhn uploaded patch set 2 CR -1 01/18/23, 16:18

  4. Christian Kuhn commented on patch set 1 CR -1 01/18/23, 16:18

    Deprecation-99615-GeneralUtilityGPMerged.rst:42 Reply

    Done
  5. core-ci voted on patch set 2 V -1 01/18/23, 16:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36121

  6. Christian Kuhn uploaded patch set 3 V -1 01/18/23, 16:37

  7. core-ci voted on patch set 3 V +1 01/18/23, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36126

  8. Christian Kuhn voted on patch set 3 V +1 CR +1 01/18/23, 17:13

  9. Stefan Bürk commented on patch set 3 01/18/23, 17:42

    Deprecation-99615-GeneralUtilityGPMerged.rst:59

    Current example is more the replacement for `GU::$_GP()` and not `GU::_GPmerged()` ... However, do not get really the old code really in `_GPMerged()` .. that expected the "parameter" to be an array too and so on ... This one do either return GET only if not set as POST, and if both not set an empty array. No merge like in the deprectaded method. I guess a more matching example would be something like: ```php $getMergedWithPost = array_replace_recursive( (array)($request->getParsedBody()['tx_scheduler'] ?? []), (array)($request->getQueryParams()['tx_scheduler'] ?? []) ); ``` which is still not fully correct. Or am I wrong here ?

    AbstractPlugin.php:1367

    This should at least get a big bold @todo to refactor this to something relying on "request" object.
  10. Benni Mack voted on patch set 3 CR +1 01/18/23, 17:43

  11. Christian Kuhn commented on patch set 3 01/18/23, 18:25

    AbstractPlugin.php:1367 Reply

    Nah. AbstractPlugin is legacy as stated in the class comment: "@internal This class is not maintained anymore and may be removed in future versions." Should be enough to go with the implementation below.
  12. Anja Leichsenring uploaded patch set 4 CR +1 V +1 01/18/23, 18:31

  13. Anja Leichsenring commented on patch set 4 01/18/23, 18:32

    Deprecation-99615-GeneralUtilityGPMerged.rst:59 Reply

    Done
  14. core-ci voted on patch set 4 V +1 01/18/23, 18:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36141

  15. Benni Mack voted on patch set 4 V +1 CR +1 01/18/23, 19:44

  16. Stefan Bürk voted on patch set 4 V +1 CR +1 01/18/23, 19:45

  17. Benni Mack commented on patch set 5 CR +1 V +1 01/18/23, 19:46

    Published edit on patch set 4.
  18. Benni Mack voted on patch set 5 V +1 CR +1 01/18/23, 19:46

  19. Stefan Bürk voted on patch set 5 V +1 CR +1 01/18/23, 19:46

  20. core-ci voted on patch set 5 V +1 01/18/23, 19:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36144

  21. Christian Kuhn voted on patch set 5 V +1 CR +1 01/18/23, 20:39

  22. Benni Mack voted on patch set 5 V +2 CR +2 01/18/23, 20:39

  23. Benni Mack merged patch set 6 01/18/23, 20:39