Review main Merged

80029[BUGFIX] Respect item group of custom page type in "New Pages" view

Nikita Hovratov CR +2 V +2 Expert +973 −148 updated 07/21/23, 19:10

Commit message

With the introduced group and sorting feature for TCA items it was ever
since possible to easily define the way items were displayed in select
drop-downs.

This feature, however, was not considered in the "New Pages" view. This
is the view, which allows to create multiple pages at once. For each
page it is possible to select the type. This select drop-down now
correctly groups and sorts custom page types. For Core types the order
was already correct like it is in the TCA definition.

To achieve this, the "group and sort" functionality needed to be
extracted into an own service. The NewPages template also needed some
adjustments, as group labels are already translated by the service.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 2331

Show 46 earlier messages
  1. Nikita Hovratov uploaded patch set 1 07/14/23, 17:23

  2. core-ci voted on patch set 1 V -1 07/14/23, 17:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44146

  3. Nikita Hovratov uploaded patch set 2 V -1 07/14/23, 17:39

  4. core-ci voted on patch set 2 V +1 07/14/23, 17:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44147

  5. Nikita Hovratov voted on patch set 2 V -1 07/14/23, 17:49

  6. Nikita Hovratov uploaded patch set 3 V +1 07/14/23, 19:12

  1. core-ci voted on patch set 3 V +1 07/14/23, 19:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44148

  2. Oliver Klee commented on patch set 3 07/14/23, 20:15

    Could we cover the new/extracted class with tests?
  3. Nikita Hovratov uploaded patch set 4 V +1 07/15/23, 11:04

  4. Nikita Hovratov commented on patch set 4 07/15/23, 11:05

    Reply

    Done.
  5. core-ci voted on patch set 4 V +1 07/15/23, 11:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44169

  6. Oliver Klee voted on patch set 4 V +1 07/15/23, 11:23

  7. Stefan Bürk commented on patch set 4 CR -1 07/20/23, 08:34

    on it ...

    GroupAndSortItemsService.php:23

    Would suggest to make this final and internal.
  8. Benni Mack commented on patch set 4 07/20/23, 09:20

    I like the idea in general!

    NewMultiplePagesController.php:214

    I wonder if we can actually move more code like the filtering logic (also from FormEngine) in the new class?

    GroupAndSortItemsService.php:23

    Sounds like a DataProvider, not a general service class. Or actually like a SelectItemProcessor ?

    GroupAndSortItemsService.php:25

    please do not inject LanguageService. We have a LanguageServiceFactory, which creates a languageService depending on the BE User (or whereever you want to use it)
  9. Nikita Hovratov commented on patch set 4 07/20/23, 11:18

    NewMultiplePagesController.php:214 Reply

    Would make sense together with the renaming below.

    GroupAndSortItemsService.php:23 Reply

    Naming is hard, yeah. Right now it only does the "group" and "sorting" thing. If we put more inside like in your comment above, we could rename it to SelectItemProcessor and put it in a Processor folder?

    GroupAndSortItemsService.php:25 Reply

    Ah ok, I did it, because in the context right now it is taken from $GLOBALS['LANG'] and I wanted the class to be instatiated with GU with the argument provided.
  10. Nikita Hovratov commented on patch set 4 07/20/23, 11:22

    GroupAndSortItemsService.php:25 Reply

    Is it ok, if we disable autowiring?
  11. Stefan Bürk uploaded patch set 5 CR -1 V +1 07/21/23, 13:40

  12. Stefan Bürk commented on patch set 5 07/21/23, 13:45

    NewMultiplePagesController.php:214 Reply

    Basically ack on moving additional code. However, moving this togheter into a internal class is done as part of a bugfix I tend to do the moving of other code fragements in a dedicated task change afterwards. That way we keep this change to the minimum needed for this bugfix.

    GroupAndSortItemsService.php:23 Reply

    Done

    GroupAndSortItemsService.php:23 Reply

    Had the same thinking. Ack on "naming is hard" ;) I took the suggestion from Nikita and pushed it as this. Also adopted it for the introduced test.

    GroupAndSortItemsService.php:25 Reply

    I added the LANG with the factory as fallback to the class. Usually, this should be called only from backend context anway. Hope, that's okay for both of you.
  13. Stefan Bürk uploaded patch set 6 07/21/23, 13:49

  14. Stefan Bürk uploaded patch set 7 07/21/23, 13:51

  15. core-ci voted on patch set 5 V -1 07/21/23, 13:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44383

  16. core-ci voted on patch set 7 V -1 07/21/23, 14:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44386

  17. core-ci voted on patch set 6 V -1 07/21/23, 14:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44385

  18. Nikita Hovratov uploaded patch set 8 V -1 07/21/23, 14:59

  19. core-ci voted on patch set 8 V +1 07/21/23, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44393

  20. Nikita Hovratov commented on patch set 8 07/21/23, 15:40

    NewMultiplePagesController.php:214 Reply

    Ack

    GroupAndSortItemsService.php:23 Reply

    Done

    GroupAndSortItemsService.php:25 Reply

    Ack
  21. Stefan Bürk voted on patch set 8 V +1 CR +1 07/21/23, 16:26

  22. Benni Mack voted on patch set 8 V +1 CR +1 07/21/23, 17:16

  23. Oliver Klee voted on patch set 8 V +1 07/21/23, 18:08

  24. Nikita Hovratov voted on patch set 8 V +2 CR +2 07/21/23, 19:10

  25. Nikita Hovratov merged patch set 9 07/21/23, 19:10