Review main Merged

77493[TASK] Reduce usages of GU::_GP()

Anja Leichsenring CR +2 V +2 Easy +22 −8 updated 01/20/23, 12:53

Commit message

The method will be phased out due to being an antipattern to
grab information directly from global variables.

This patch replaces all usages of GU::_GP(), where a PSR-7
Server Request Object is available.

Review

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

Issues 1

Files 6

Review log 3245

Show 1320 earlier messages
  1. Anja Leichsenring uploaded patch set 1 01/19/23, 10:47

  2. core-ci voted on patch set 1 V -1 01/19/23, 11:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36190

  3. Anja Leichsenring uploaded patch set 2 V -1 01/19/23, 11:10

  4. Anja Leichsenring uploaded patch set 3 01/19/23, 11:24

  5. core-ci voted on patch set 2 V -1 01/19/23, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36198

  6. Stefan Bürk commented on patch set 3 01/19/23, 12:04

    PageInfoViewHelper.php:60

    getRequest() can return null, should be guarded ( ex. `TYPO3\CMS\Fluid\ViewHelpers\Uri\PageViewHelper` )

    PagePathViewHelper.php:59

    see PageInfoViewHelper
  7. Anja Leichsenring uploaded patch set 4 01/19/23, 12:07

  8. core-ci voted on patch set 3 V -1 01/19/23, 12:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36204

  9. Anja Leichsenring uploaded patch set 5 01/19/23, 12:20

  10. Anja Leichsenring commented on patch set 5 01/19/23, 12:21

    PageInfoViewHelper.php:60 Reply

    Done

    PagePathViewHelper.php:59 Reply

    Done
  11. core-ci voted on patch set 5 V -1 01/19/23, 13:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36227

  12. Anja Leichsenring uploaded patch set 6 V -1 01/19/23, 13:24

  13. Anja Leichsenring uploaded patch set 7 01/19/23, 13:45

  14. core-ci voted on patch set 6 V -1 01/19/23, 13:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36245

  15. core-ci voted on patch set 7 V +1 01/19/23, 13:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36249

  16. Stefan Bürk updated the commit message in patch set 8 V +1 01/19/23, 23:57

  17. core-ci voted on patch set 8 V +1 01/20/23, 00:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36289

  18. Stefan Bürk voted on patch set 8 V +1 CR +1 01/20/23, 00:06

  19. Georg Ringer commented on patch set 8 CR -1 01/20/23, 06:16

    DatabaseRecordList.php:2128

    This is a breaking change, please use a new Argument
  20. Stefan Bürk commented on patch set 8 01/20/23, 08:17

    DatabaseRecordList.php:2128 Reply

    Had the same thought as you first. The class is marked as internal, thus breaking is non-breaking.
  1. Anja Leichsenring commented on patch set 8 01/20/23, 09:20

    DatabaseRecordList.php:2128 Reply

    exactly, not breaking due to internal class.
  2. Anja Leichsenring updated the commit message in patch set 9 CR +1 V +1 01/20/23, 09:31

  3. Anja Leichsenring updated the commit message in patch set 10 01/20/23, 09:31

  4. Jörg Bösche voted on patch set 10 CR +1 01/20/23, 09:37

  5. core-ci voted on patch set 9 V +1 01/20/23, 09:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36311

  6. core-ci voted on patch set 10 V +1 01/20/23, 09:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36312

  7. Georg Ringer commented on patch set 10 01/20/23, 10:08

    DatabaseRecordList.php:2128 Reply

    I know but we can in this case still choose to make the life easier or harder ...
  8. Benni Mack commented on patch set 10 01/20/23, 10:33

    DatabaseRecordList.php:2128 Reply

    for the sake of getting rid of GP(), I would not do it. I would rather like to streamline the class to be similar to the FileList class, and use a SearchDemand object just as in FileList and get rid of all other parameters as well (so, basically let's use a new method ->generate(?SearchDemand $searchDemand) and deprecate start - but that's another topic. That's why I would not include the whole DatabaseRecordList part in this change - my 2 cents.
  9. Stefan Bürk commented on patch set 10 01/20/23, 10:37

    DatabaseRecordList.php:2128 Reply

    having a "required" argument after optional arguemnts does not help to ease it anyway - as named arguemtn calling would not be possible vor a v11/v12 compat mode as v11 does support PHP7.4 without named argument support ... and having it optional would not help either. So extensions using `internal` stuff on `own risk` still needs to provide version depending switched code, if it is in the middle or at the end ...
  10. Anja Leichsenring commented on patch set 10 01/20/23, 10:45

    DatabaseRecordList.php:2128 Reply

    I will revert the change to the start() method. The other hunk should be safe.
  11. Anja Leichsenring uploaded patch set 11 CR +1 V +1 01/20/23, 10:47

  12. Anja Leichsenring uploaded patch set 12 01/20/23, 10:48

  13. Anja Leichsenring uploaded patch set 13 01/20/23, 10:50

  14. Anja Leichsenring uploaded patch set 14 01/20/23, 11:15

  15. Anja Leichsenring commented on patch set 14 01/20/23, 11:16

    DatabaseRecordList.php:2128 Reply

    Done
  16. core-ci voted on patch set 13 V -1 01/20/23, 11:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36329

  17. Anja Leichsenring uploaded patch set 15 01/20/23, 11:24

  18. Anja Leichsenring uploaded patch set 16 01/20/23, 11:28

  19. core-ci voted on patch set 15 V -1 01/20/23, 11:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36337

  20. core-ci voted on patch set 14 V -1 01/20/23, 11:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36335

  21. core-ci voted on patch set 16 V +1 01/20/23, 11:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36339

  22. Christian Kuhn voted on patch set 16 V +1 CR +1 01/20/23, 12:34

  23. Stefan Bürk voted on patch set 16 V +1 CR +1 01/20/23, 12:46

  24. Christian Kuhn voted on patch set 16 V +2 CR +2 01/20/23, 12:53

  25. Christian Kuhn merged patch set 17 01/20/23, 12:53