Review main Merged

83153[FEATURE] Support comma-separated lists in page tree filter

Philipp Kitzberger CR +2 V +2 Hard +262 −4 updated 04/13/24, 11:50

Commit message

It's now possible to filter the page tree not only by strings and single
uids but by comma-separated lists of uids.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Guido Schmechel +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Guido Schmechel +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 4662

Show 2537 earlier messages
  1. Philipp Kitzberger uploaded patch set 1 02/28/24, 00:19

  2. core-ci voted on patch set 1 V -1 02/28/24, 00:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53665

  3. Philipp Kitzberger uploaded patch set 2 V -1 02/28/24, 00:59

  4. Philipp Kitzberger uploaded patch set 3 02/28/24, 01:01

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

  6. core-ci voted on patch set 3 V -1 02/28/24, 01:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53667

  7. Philipp Kitzberger uploaded patch set 4 V -1 02/28/24, 01:16

  8. core-ci voted on patch set 4 V +1 02/28/24, 01:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53669

  9. Josef Glatz commented on patch set 4 CR -1 02/28/24, 04:02

    rST feature file missing (but didn’t checked the code)
  10. Philipp Kitzberger uploaded patch set 5 CR -1 V +1 02/28/24, 08:03

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

  12. Chris Müller uploaded patch set 6 V +1 02/28/24, 20:14

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

  14. Andreas Kienast commented on patch set 6 02/29/24, 12:32

    PageTreeRepository.php:548

    I'd love to see an `array_unique()` here.
  15. Andreas Kienast commented on patch set 6 CR -1 02/29/24, 12:34

    PageTreeRepository.php:548 Reply

    Also, I'm not sure whether `array_filter()` is needed as `true` is passed to `intExplode()`. Also, I we need some sanitization regarding negative values again (`array_filter` comes in handy again).
  16. Garvin Hicking commented on patch set 6 02/29/24, 12:40

    Love this! Will test later, some comments

    PageTreeRepositoryTest.php:330

    Should we add also tests for "string,int,string" and "string.string" here? and "sameInt,sameInt", "negativeInt"?

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14

    Maybe formulate this more passively like usual: "The page tree has been enhanced by..."?
  17. Philipp Kitzberger uploaded patch set 7 CR -1 V +1 02/29/24, 14:29

  18. Philipp Kitzberger uploaded patch set 8 02/29/24, 14:32

  19. core-ci voted on patch set 7 V -1 02/29/24, 14:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53726

  20. core-ci voted on patch set 8 V -1 02/29/24, 14:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53727

  21. Philipp Kitzberger uploaded patch set 9 V -1 02/29/24, 15:42

  22. Philipp Kitzberger commented on patch set 8 02/29/24, 15:43

    Reply

    Done

    PageTreeRepository.php:548 Reply

    `array_filter()` is necessary for `GeneralUtility::intExplode(',', '', true)` returning `[0]` and for comma separated strings even more bigger arrays of zeros like `[0, ..., 0]` But you're right, negative values need to be filtered out as well. Please have a look at latest patchset.

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14 Reply

    Done
  23. core-ci voted on patch set 9 V +1 02/29/24, 15:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53728

  24. Garvin Hicking commented on patch set 9 V +1 02/29/24, 17:18

    Tested and works fine for me!

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14

    "has" not "hase" - but I also think you accidentally overwrote Chris' patches to the changelog which improved a few other changes, or was that by intention?
  25. Chris Müller commented on patch set 9 02/29/24, 18:17

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14 Reply

    Yup, my change was overriden :-(
  26. Chris Müller uploaded patch set 10 V +1 02/29/24, 18:42

  27. Chris Müller commented on patch set 10 02/29/24, 18:43

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14 Reply

    Fixed.
  28. core-ci voted on patch set 10 V +1 02/29/24, 18:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53735

  29. Philipp Kitzberger commented on patch set 10 02/29/24, 19:26

    Feature-103220-EnhancePagetreeFilterBySupportingListsOfPids.rst:14 Reply

    Sorry, didn't mean to!
  30. Benni Mack commented on patch set 10 02/29/24, 19:52

    PageTreeRepositoryTest.php:330 Reply

    yes. I wonder what happens if I type in "page30"
  31. Philipp Kitzberger commented on patch set 10 02/29/24, 19:54

    PageTreeRepositoryTest.php:330 Reply

    not much. it'll search for a page with that phrase in its title. same for "30page". intExplode will eliminate those "non-numbers" and thus not include them in the pid-lookup.
  32. Garvin Hicking commented on patch set 10 02/29/24, 20:11

    PageTreeRepositoryTest.php:330 Reply

    But we should still verify that with a test in case someone(tm) ever tries to to replace intExplode with something else, or otherwise change the parsing routine and then the results could change without noticing.
  33. Philipp Kitzberger uploaded patch set 11 V +1 03/02/24, 09:42

  34. core-ci voted on patch set 11 V -1 03/02/24, 09:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53770

  35. Philipp Kitzberger commented on patch set 11 03/02/24, 09:51

    PageTreeRepositoryTest.php:330 Reply

    I was wrong! `intExplode` of course casts "30page" to "30", that's why I've switched now from `intExplode` to `trimExplode` in combination with `is_number` from before and applying `intval` them manually. Additionally there 3 more tests, even covering the "no results" case for non-matching strings.
  36. core-ci commented on patch set 11 03/02/24, 11:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53770

  37. Philipp Kitzberger rebased onto patch set 12 V -1 03/02/24, 11:32

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

  2. Garvin Hicking commented on patch set 12 03/02/24, 13:34

    PageTreeRepositoryTest.php:330 Reply

    Nice, that was worth it then ☺️ How about "30,string,31" as well, to ensure ints still match even when a string is involved? And a "-30,31" to only match "31"?
  3. Philipp Kitzberger uploaded patch set 13 V +1 03/02/24, 13:46

  4. Philipp Kitzberger commented on patch set 13 03/02/24, 13:48

    Done ;-)

    PageTreeRepositoryTest.php:330 Reply

    Done
  5. core-ci voted on patch set 13 V +1 03/02/24, 13:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53778

  6. Garvin Hicking commented on patch set 13 CR +1 V +1 03/02/24, 15:59

    👍
  7. Stefan Bürk commented on patch set 13 CR -1 03/04/24, 17:41

    Nitpick: Let's manually break the commit a little bit earlier and not avoid exceeding the maximum commit message line length (and breaking weired in gerrit).

    PageTreeRepository.php:551

    `is_numeric()` is not good here, as this would return true or float-like string or exponent notation, see: https://3v4l.org/lfOW7 ``` var_dump(is_numeric('123.98')); // returs true var_dump(is_numeric('123e23')); // return true ``` therfore `MathUtility::canBeInterpretedAsInteger()` should be used here. Additionally, it doesn't make sense to have `array_filter()`, `array_map()` and than an additionally array_unique(). I would suggest to use a `foreach()` loop here and add only values which can be interpreted as integer, casted as integer to a new array if not contained in it - or with a array_uniquie() afterwards. but at least we should combine the filter and map in some way. Note: float and exponent like syntax should be added to the tests also.
  8. Stefan Bürk commented on patch set 13 03/04/24, 17:46

    PageTreeRepository.php:551 Reply

    Small additional side-note: if `array_map()` is used, we normally use ``` array_map(intval(...), $array); ``` nowerdays.
  9. Philipp Kitzberger uploaded patch set 14 CR +1 V +1 03/04/24, 23:26

  10. Philipp Kitzberger commented on patch set 13 03/04/24, 23:29

    Reply

    Done

    PageTreeRepository.php:551 Reply

    Thanks for your feedback! Please have another look.
  11. core-ci voted on patch set 14 V +1 03/04/24, 23:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53912

  12. Simon Schaufelberger voted on patch set 14 CR +1 03/22/24, 23:44

  13. Garvin Hicking voted on patch set 14 CR +1 V +1 04/05/24, 10:58

  14. Jörg Bösche voted on patch set 14 CR +1 04/11/24, 13:37

  15. Fabien Udriot voted on patch set 14 CR +1 04/11/24, 14:54

  16. Guido Schmechel voted on patch set 14 CR +1 V +1 04/12/24, 17:44

  17. Guido Schmechel commented on patch set 14 CR 0 04/12/24, 17:45

    The file name of the RST would probably have to be adapted?
  18. Simon Schaufelberger uploaded patch set 15 CR +1 V +1 04/12/24, 19:11

  19. Simon Schaufelberger voted on patch set 15 CR +1 V +1 04/12/24, 19:11

  20. core-ci voted on patch set 15 V +1 04/12/24, 19:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55878

  21. Garvin Hicking voted on patch set 15 CR +1 V +1 04/12/24, 20:32

  22. Guido Schmechel voted on patch set 15 CR +1 V +1 04/13/24, 08:21

  23. Benni Mack voted on patch set 15 CR +1 V +1 04/13/24, 11:50

  24. Benni Mack voted on patch set 15 CR +2 V +2 04/13/24, 11:50

  25. Benni Mack merged patch set 16 04/13/24, 11:50