Review main Merged

74186[FEATURE] Differentiate redirects based on creation type

Georg Ringer CR +2 V +2 Hard +186 −67 updated 01/20/23, 09:43

Commit message

A new field in the redirect table allows to distinguish
between redirects created automatically because the slug
changed and the ones created by editors in the backend
module.

A new filter in the backend module based on this field
helps to administrate the records better.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Kevin Appelt +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Kevin Appelt +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 15

Review log 4459

Show 2534 earlier messages
  1. Georg Ringer uploaded patch set 1 04/05/22, 17:21

  2. Georg Ringer commented on patch set 1 04/05/22, 17:21

    This change is ready for review.
  3. core-ci voted on patch set 1 V -1 04/05/22, 17:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25547

  4. Georg Ringer uploaded patch set 2 04/05/22, 18:21

  5. core-ci voted on patch set 2 V -1 04/05/22, 18:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25550

  6. Stefan Bürk commented on patch set 2 04/05/22, 19:11

    Demand.php:232

    Do I miss something, or should this be `getCreationType()` (along with all callings/usages) ?
  7. Georg Ringer uploaded patch set 3 04/05/22, 19:21

  8. Chris Müller commented on patch set 3 04/05/22, 19:29

    Demand.php:239

    Maybe we can use a backed enum, so it is clear what 1 and 2 are meaning. Also, we have a better type safety than with an int.
  9. core-ci voted on patch set 3 V -1 04/05/22, 19:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25555

  10. Georg Ringer commented on patch set 4 04/06/22, 04:17

    Published edit on patch set 3.
  11. core-ci voted on patch set 4 V +1 04/06/22, 04:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25574

  12. Oli Bartsch commented on patch set 4 CR -1 04/06/22, 07:49

    Demand.php:48

    Missing whitespace

    Demand.php:239 Reply

    I don't understand the reason for the "int" approach at all. The field is defined as checkbox (in TCA). A simple toggle between automatically and manually created. So why not just using a bool flag "$automaticallyCreated"?

    RedirectRepository.php:118

    Shouldn't we keep this information? Maybe change to "Used e.g. for filtering in the backend".

    Overview.html:276

    Seems to be unrelated and will furthermore lead to inconsistency with the other filters in belog and beusers.
  13. Georg Ringer commented on patch set 4 04/06/22, 08:17

    Demand.php:239 Reply

    because it should be possible show the ones with 0 or the ones with 1 and to know if the filter is set or not

    RedirectRepository.php:118 Reply

    can be added of course again but more correct is IMO what the method does not and not where it might be used

    Overview.html:276 Reply

    unrelated but makes the UI cleaner as it only shows the reset if needed
  14. Oli Bartsch commented on patch set 4 04/06/22, 08:53

    Demand.php:239 Reply

    Shouldn't this be done with "?bool $automaticallyCreated" instead? So null for not set ("Both options") and if set either false (manually) or true (automatically). Creating from request this would be sth like: if (($demand['automatically_created'] ?? '') === '') { $this->automaticallyCreated = null; } else { $this->automaticallyCreated = (bool)$demand['automatically_created']; } And for example this method would be: public function hasCreationConstraint(): bool { return $this->automaticallyCreated !== null; }

    RedirectRepository.php:118 Reply

    Ack

    Overview.html:276 Reply

    I agree on the UI improvement, however this should be done in a separate patch for all filters in the backend to keep consistency.
  15. Georg Ringer commented on patch set 4 CR -2 04/06/22, 09:24

    will update patch later
  16. Georg Ringer uploaded patch set 5 04/06/22, 11:06

  17. Georg Ringer voted on patch set 5 CR 0 04/06/22, 11:06

  18. core-ci voted on patch set 5 V +1 04/06/22, 11:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25620

  19. Georg Ringer uploaded patch set 6 04/06/22, 16:36

  20. core-ci voted on patch set 6 V +1 04/06/22, 16:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25675

  21. Stefan Bürk commented on patch set 6 CR -1 04/06/22, 17:10

    on it
  22. Stefan Bürk uploaded patch set 7 04/06/22, 17:50

  23. core-ci voted on patch set 7 V +1 04/06/22, 18:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25689

  24. Stefan Bürk commented on patch set 7 V +1 CR +1 04/06/22, 19:35

    Demand.php:48 Reply

    Done

    Demand.php:232 Reply

    Done

    Demand.php:239 Reply

    Georg adjusted his patch. Now it is not a checkbox and it make more sense, I think.

    Overview.html:276 Reply

    Done
  25. Oli Bartsch commented on patch set 7 04/06/22, 20:06

    RedirectCreationTypeUpdate.php:27

    Why do we need an upgrade wizard for a completely new field? IMO the SQL default "0" should be equal to "manually created". Otherwise, the SQL default "0" does not represent anything and does also not match the TCA default. The "All types" can also be selected in the modal while having the default be "0". We would just need some additional strict checks.
  26. Oli Bartsch voted on patch set 7 CR -1 04/06/22, 20:06

  27. Oli Bartsch commented on patch set 7 04/06/22, 20:08

    RedirectCreationTypeUpdate.php:27 Reply

    Actually the "All types" option in the module does already use an empty string and not the "0". So we would just need some additional checks to get this straight.
  28. Georg Ringer uploaded patch set 8 04/07/22, 13:23

  29. Georg Ringer commented on patch set 7 04/07/22, 13:24

    RedirectCreationTypeUpdate.php:27 Reply

    what about setting the default value for the DB to 1? I like to avoid having 0 for all as this would then lead to more checks
  30. core-ci voted on patch set 8 V -1 04/07/22, 13:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25750

  31. Georg Ringer uploaded patch set 9 07/21/22, 19:14

  32. core-ci voted on patch set 9 V -1 07/21/22, 19:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29408

  33. Simon Schaufelberger commented on patch set 9 07/21/22, 20:47

    SlugService.php:206

    could we use a constant here so that we know what 2 means?
  34. Stefan Bürk commented on patch set 10 07/21/22, 21:05

    Published edit on patch set 9.
  1. core-ci voted on patch set 10 V +1 07/21/22, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29410

  2. Guido Schmechel commented on patch set 10 07/21/22, 21:37

    Does it make sense to think about a third type here, e.g. "external"? For example by an importer or the EXT:redirect_generator ;-) That would give more possibilities for filtering.
  3. Stefan Bürk commented on patch set 10 07/21/22, 21:43

    Reply

    EXT:redirect_generator can simply add a custom type per TCA configuration. No need to add "fictive" types by core which core does not need directly. Same goes for project internal use or making kind of "categorization" in projetcs.
  4. Stefan Bürk commented on patch set 10 07/21/22, 22:15

    Reply

    From Feature ReST file: ``` If desired, the available items of the field `creation_type` can be extended with additional type by adjusting TCA for this field. This simplifies the registration of additional types, which automatically are available in backend filtering. Possible use-cases are for example synced redirects or migrated from other / old sources sources. ``` However, added a comment there to provice some example for it ...

    Feature-97309-DifferentiateRedirectsBasedOnCreationType.rst:31

    Maybe we should add a example to showcase this and help the documentation team to further document this then later. Or maybe, we should directy add a section to the ext:redirects extension documentation ?
  5. Guido Schmechel commented on patch set 10 07/22/22, 10:36

    Feature-97309-DifferentiateRedirectsBasedOnCreationType.rst:31 Reply

    Good point. I would suggest that we add a TCA example here in the RST. We usually do that in other RST files as well. And then later we can extend the redirects doc. Probably even copy & paste is enough.
  6. Guido Schmechel commented on patch set 10 07/24/22, 07:13

    RedirectRepository.php:217

    Small hint: "creation_type"
  7. Chris Müller commented on patch set 10 07/24/22, 17:09

    Feature-97309-DifferentiateRedirectsBasedOnCreationType.rst:31 Reply

    As the redirects documentation is already available in the system extension itself this patch can enhance the documentation directly (which would be very nice) so there is no need to afterwards add a new patch to enhance the docs with this feature.
  8. Chris Müller uploaded patch set 11 07/26/22, 17:33

  9. core-ci voted on patch set 11 V +1 07/26/22, 17:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29560

  10. Benni Mack commented on patch set 11 09/27/22, 13:41

    anyone care to update this patch?
  11. Georg Ringer uploaded patch set 12 09/27/22, 16:54

  12. Georg Ringer commented on patch set 12 09/27/22, 16:54

    Feature-97309-DifferentiateRedirectsBasedOnCreationType.rst:31 Reply

    Done

    RedirectCreationTypeUpdate.php:27 Reply

    Done

    RedirectRepository.php:217 Reply

    Done

    SlugService.php:206 Reply

    as those will be extended anyway I would like to avoid it, also it is now 0 anyway
  13. core-ci voted on patch set 12 V -1 09/27/22, 17:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31604

  14. Georg Ringer commented on patch set 13 09/27/22, 17:28

    Published edit on patch set 12.
  15. core-ci voted on patch set 13 V +1 09/27/22, 17:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31611

  16. Georg Ringer rebased onto patch set 14 10/01/22, 19:58

  17. core-ci voted on patch set 14 V +1 10/01/22, 20:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31845

  18. Georg Ringer commented on patch set 14 10/02/22, 18:06

    Demand.php:239 Reply

    Done

    SlugService.php:206 Reply

    Done
  19. Chris Müller uploaded patch set 15 10/21/22, 09:48

  20. core-ci voted on patch set 15 V +1 10/21/22, 09:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32574

  21. Kevin Appelt commented on patch set 15 V +1 CR +1 11/03/22, 19:00

    Looks good and I already like the feature.
  22. Anja Leichsenring voted on patch set 15 V +1 CR +1 11/03/22, 19:38

  23. Stefan Bürk voted on patch set 15 V +2 CR +2 11/03/22, 19:38

  24. Stefan Bürk merged patch set 16 11/03/22, 19:38

  25. Mathias Brodala commented on patch set 16 01/20/23, 09:43

    Just my two cents: a varchar field would be better IMO for readable type names with a clearer origin e.g. by package prefix, etc (same reasoning as the change itself ;-)