Review main Merged

77675[FEATURE] Introduce new PSR-14 BeforeRedirectMatchDomainEvent

Stefan Bürk CR +2 V +2 Hard +340 −23 updated 03/21/23, 01:42

Commit message

A new PSR-14 event `BeforeRedirectMatchDomainEvent` is introduced
to the RedirectService, allowing extension authors to implement a
custom redirect matching.

This can be used to implement custom logic to match the request
and determine a redirect. For example, dealing with `GET` request
params and changing the target based on the value of an parameter.

Therefore, special and rare use-cases can be implemented avoiding
complex all-scenario match logic in the core and keeping it to a
generic and overall cases in the core-implementation.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Guido Schmechel +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Guido Schmechel +1
    • core-ci +1 CI

Issues 1

Files 8

Review log 3850

Show 1925 earlier messages
  1. Stefan Bürk uploaded patch set 1 02/02/23, 22:39

  2. core-ci voted on patch set 1 V +1 02/02/23, 22:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36942

  3. Andreas Steiner wrote 02/03/23, 10:09

    Removed cc Andreas Steiner.
  4. Georg Ringer voted on patch set 1 V +1 CR +1 02/03/23, 10:23

  5. Stefan Froemken commented on patch set 1 CR -1 02/03/23, 10:53

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:51

    space

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:52

    TYPO3 CGL: "Inline comments must precede the commented line"

    BeforeRedirectMatchDomainEvent.php:89

    3 spaces => 1 space should be enough
  6. Stefan Bürk uploaded patch set 2 CR +1 V +1 02/03/23, 11:25

  7. Stefan Bürk commented on patch set 2 02/03/23, 11:25

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:51 Reply

    Done

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:52 Reply

    Done

    BeforeRedirectMatchDomainEvent.php:89 Reply

    Done
  8. core-ci voted on patch set 2 V +1 02/03/23, 11:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36979

  9. Stefan Froemken voted on patch set 2 CR +1 02/03/23, 12:26

  10. Stefan Bürk commented on patch set 3 CR +1 V +1 02/05/23, 19:55

    Published edit on patch set 2.
  11. core-ci voted on patch set 3 V +1 02/05/23, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37127

  12. Benni Mack commented on patch set 3 02/05/23, 23:12

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:16

    what does "matching making" mean?
  13. Stefan Bürk uploaded patch set 4 V +1 02/06/23, 05:00

  14. Stefan Bürk commented on patch set 3 02/06/23, 05:01

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:16 Reply

    german and missing sleep. anyway, sentence did not made much sense, and was a duplicat from the one before. Changed the phrasing a little bit.
  15. core-ci voted on patch set 4 V +1 02/06/23, 05:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37139

  16. Lina Wolf commented on patch set 4 CR -1 02/06/23, 14:28

    Working on the changelog entry, please do not override me
  17. Lina Wolf uploaded patch set 5 CR -1 V +1 02/06/23, 14:36

  18. Lina Wolf commented on patch set 5 V +1 CR +1 02/06/23, 14:38

    I reviewed and corrected the changelog entry, it renders without problems now and the included php lints. The code looks ok to me but someone else must decide on that part.
  19. core-ci voted on patch set 5 V +1 02/06/23, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37171

  20. Stefan Froemken voted on patch set 5 CR +1 02/08/23, 07:13

  21. Benni Mack commented on patch set 6 CR +1 V +1 02/08/23, 07:48

    Published edit on patch set 5.
  22. core-ci voted on patch set 6 V +1 02/08/23, 07:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37326

  23. Stefan Froemken voted on patch set 6 CR +1 02/09/23, 10:08

  24. Stefan Bürk voted on patch set 6 CR -1 02/09/23, 20:24

  25. Stefan Bürk uploaded patch set 7 CR +1 V +1 02/23/23, 10:35

  1. core-ci voted on patch set 7 V +1 02/23/23, 10:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38004

  2. Andreas Kienast commented on patch set 7 02/25/23, 14:49

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:34

    "this [is] not available", but what does that mean?

    RedirectService.php:72

    IMO we don't need named arguments here.
  3. Sybille Peters commented on patch set 7 02/25/23, 15:19

    > This can be used to implement matching making which are not generic useful or following rare and special requirements. suggestion: "This can be used to implement matches which are not to be applied in general for rare and special requirements." (not sure if I understood intention 100%)

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:44

    Add :caption: with the file name
  4. Sybille Peters uploaded patch set 8 V +1 02/25/23, 15:21

  5. Sybille Peters commented on patch set 8 CR +1 02/25/23, 15:22

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:44 Reply

    Done
  6. core-ci voted on patch set 8 V +1 02/25/23, 15:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38102

  7. Stefan Bürk uploaded patch set 9 CR +1 V +1 02/26/23, 15:48

  8. Stefan Bürk commented on patch set 9 02/26/23, 15:48

    Reply

    Changed.

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:34 Reply

    Yeah, missed during rewrite. Anyway, changed the wording/sentance and hope it is now clearer what is meant.

    RedirectService.php:72 Reply

    In the the end, there would never be a real use-case where it would be needed as there is always a way doing it without it (generally). It does not harm it anyway, and it make it kind of more readable and helps in IDE's, also this is not a real hard required argument. I leave it for now as it is, as there is no general rule when and when not yet. If this would be a code part for a backport, I would have omitted in the first place. But it's only for PHP8.1 and there for okay to use this. Or what speaks against using named arguments ?
  9. core-ci voted on patch set 9 V +1 02/26/23, 15:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38121

  10. Sybille Peters commented on patch set 9 CR +1 02/26/23, 16:31

    Reply

    Done
  11. Stefan Bürk uploaded patch set 10 CR +1 V +1 03/17/23, 06:11

  12. Stefan Bürk commented on patch set 10 03/17/23, 06:12

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:34 Reply

    Done

    RedirectService.php:72 Reply

    Removed named arguments for now until final decision.
  13. core-ci voted on patch set 10 V +1 03/17/23, 06:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39097

  14. Stefan Froemken commented on patch set 10 CR -1 03/17/23, 11:44

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:80

    This table does not exists
  15. Stefan Froemken uploaded patch set 11 CR -1 V +1 03/17/23, 12:14

  16. Stefan Froemken commented on patch set 11 03/17/23, 12:16

    Feature-99803-NewPSR-14BeforeRedirectMatchDomainEvent.rst:80 Reply

    Done
  17. Stefan Froemken commented on patch set 11 V +1 CR +1 03/17/23, 12:18

    Patch is OK. Maybe it would be good to add a note, that the return value of the EventListener should be a valid sys_redirect record with an UID. Later on in the TYPO3 source the UID will be used for X-Redirect-By header. So, don't just return an half-filled array with source, target and status and hope that it will work. Nope...it will not!
  18. core-ci voted on patch set 11 V +1 03/17/23, 12:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39122

  19. Stefan Bürk uploaded patch set 12 CR +1 V +1 03/18/23, 10:58

  20. Stefan Bürk commented on patch set 12 03/18/23, 10:59

    Reply

    Done. Added some remarks in the rest file, docblock for the event getter and setter.
  21. core-ci voted on patch set 12 V +1 03/18/23, 11:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39183

  22. Guido Schmechel voted on patch set 12 V +1 CR +1 03/20/23, 21:00

  23. Georg Ringer voted on patch set 12 V +1 CR +1 03/20/23, 21:11

  24. Stefan Bürk voted on patch set 12 V +2 CR +2 03/21/23, 01:42

  25. Stefan Bürk merged patch set 13 03/21/23, 01:42