Review main Merged

84608[TASK] Move slug normalization into dedicated class

Rozbeh Chiryai Sharahi CR +2 V +2 Hard +244 −36 updated 06/13/24, 12:57

Commit message

The current `SlugHelper` implementation make several
tasks hard to implement, for example language aware
transliteration, customization for extension tables
or 3rd party data adaptations.

It makes sense to extract the `slug (url segment)`
sanitization into a dedicated normalization class
as a preparation for further improvements and also
making the new implementation DI aware right from
the start.

Other parts will be streamlined in further changes
to modernize the slightly unhandy `SlugHelper`.

This change moves the slug normalization code now
from the `SlugHelper::sanitize()` method into a
dedicated class, adjusts the `SlugHelper` tests
and duplicate the tests for the new implementation.

Review

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

Issues 1

Files 4

Review log 2337

Show 712 earlier messages
  1. Rozbeh Chiryai Sharahi uploaded patch set 1 06/11/24, 09:48

  2. Rozbeh Chiryai Sharahi uploaded patch set 2 06/11/24, 09:53

  3. core-ci voted on patch set 1 V -1 06/11/24, 10:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59153

  4. core-ci voted on patch set 2 V -1 06/11/24, 10:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59154

  5. Rozbeh Chiryai Sharahi uploaded patch set 3 V -1 06/11/24, 10:24

  6. core-ci voted on patch set 3 V +1 06/11/24, 10:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59161

  7. Stefan Bürk updated the commit message in patch set 4 V +1 06/11/24, 13:02

  8. Stefan Bürk voted on patch set 4 CR -1 06/11/24, 13:02

  9. core-ci voted on patch set 4 V +1 06/11/24, 13:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59190

  10. Rozbeh Chiryai Sharahi uploaded patch set 5 CR -1 V +1 06/11/24, 14:40

  11. Rozbeh Chiryai Sharahi uploaded patch set 6 06/11/24, 14:44

  12. core-ci voted on patch set 5 V +1 06/11/24, 14:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59202

  1. core-ci voted on patch set 6 V +1 06/11/24, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59203

  2. Stefan Bürk uploaded patch set 7 V +1 06/11/24, 20:53

  3. Stefan Bürk commented on patch set 7 CR -1 06/11/24, 20:59

    still on it ..
  4. core-ci voted on patch set 7 V +1 06/11/24, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59254

  5. Stefan Bürk uploaded patch set 8 CR -1 V +1 06/12/24, 09:39

  6. core-ci voted on patch set 8 V -1 06/12/24, 09:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59301

  7. Stefan Bürk uploaded patch set 9 V -1 06/12/24, 10:12

  8. core-ci voted on patch set 9 V -1 06/12/24, 10:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59307

  9. Stefan Bürk uploaded patch set 10 V -1 06/12/24, 10:21

  10. core-ci voted on patch set 10 V +1 06/12/24, 10:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59309

  11. Stefan Bürk commented on patch set 10 06/12/24, 10:28

    Reply

    Done
  12. Rozbeh Chiryai Sharahi commented on patch set 10 06/12/24, 12:58

    SlugNormalizer.php:40

    @stefan@buerk.tech I still think that this is some kind of misunderstanding. The only caller of this method is SlugHelper::sanitize which has already a null fallback to `-`. There is no need allow such a call: ``` SlugNormalizer::normalize('my string', null); ``` However, this is still possibile ``` SlugNormalizer::normalize('my string'); ```
  13. Rozbeh Chiryai Sharahi updated the commit message in patch set 11 V +1 06/12/24, 13:00

  14. Benni Mack commented on patch set 11 06/12/24, 13:04

    I'm fine with this change (in general)
  15. core-ci voted on patch set 11 V +1 06/12/24, 13:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59326

  16. Rozbeh Chiryai Sharahi commented on patch set 11 06/12/24, 13:23

    SlugNormalizer.php:40 Reply

    In person we discussed and stefan convinced me to stay for now with a nullable paramater.
  17. Rozbeh Chiryai Sharahi updated the commit message in patch set 12 V +1 06/13/24, 09:27

  18. core-ci voted on patch set 12 V +1 06/13/24, 09:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59441

  19. Stefan Bürk updated the commit message in patch set 13 V +1 06/13/24, 11:14

  20. Stefan Bürk updated the commit message in patch set 14 06/13/24, 11:14

  21. core-ci voted on patch set 14 V +1 06/13/24, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59468

  22. core-ci voted on patch set 13 V +1 06/13/24, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59466

  23. Stefan Bürk voted on patch set 14 CR +1 V +1 06/13/24, 11:47

  24. Benni Mack commented on patch set 14 CR +2 V +2 06/13/24, 12:57

    Thanks for adding the tests, I really enjoyed reading them!
  25. Benni Mack merged patch set 15 06/13/24, 12:57