Review main Abandoned

82691[FEATURE] Add event to modify isInternalUrl result

Daniel Siepmann CR 0 V 0 Normal +109 −1 updated 04/25/24, 06:04

Commit message

A new event ModifyIsInternalUrlEvent is added which allows to modify the
outcome of the isInternalUrl check while building links.

This allows to explicitly mark a URL as internal, even if TYPO3 doesn't
know it out of the box. E.g. because it is managed by another system.
This also allows to explicitly mark a URL not to be internal, e.g.
because it is managed by TYPO3, but not rendered by TYPO3.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 3

Review log 1925

  1. Daniel Siepmann uploaded patch set 1 01/29/24, 08:29

  2. Daniel Siepmann uploaded patch set 2 01/29/24, 08:31

  3. core-ci voted on patch set 1 V -1 01/29/24, 08:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52395

  4. Daniel Siepmann uploaded patch set 3 01/29/24, 08:36

  5. core-ci voted on patch set 2 V -1 01/29/24, 08:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52396

  6. core-ci voted on patch set 3 V +1 01/29/24, 08:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52397

  7. Oliver Klee voted on patch set 3 CR +1 01/29/24, 08:47

  8. Benni Mack commented on patch set 3 01/29/24, 08:51

    LinkFactory.php:328

    have you seen the information on the methods comment?
  9. Daniel Siepmann commented on patch set 3 01/29/24, 08:52

    LinkFactory.php:328 Reply

    I guess you mean the note regarding refactoring? I wanted to keep things small and not investigate regarding the refactoring. Or do you mean I should convert the url to a PSR-7 Uri and pass that to the event, to keep it future compatible?
  10. Chris Müller commented on patch set 3 01/29/24, 16:48

    I would like to see a usage example in the changelog (like for other events). Additionally, I haven't known about internal and non-internal links by now. Can you give a short introduction what it is and what it is good for in the changelog for people like me?
  11. Stefan Bürk commented on patch set 3 01/29/24, 17:20

    Reply

    Chris, TYPO3 has a long standing history differencing between internal and external links regarding typolink. Also the linkvalidator is respecting this. Basically, links containing "full domain" are often considered external links - or if it is not a host configured in some cases. I guess, the goal of this event is to mark for example a "https://some.domain.tld/link/"; as "internal link" regarding link styling etc - to be similar handled liked pure internal (relative) links. https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Setup/Config/Index.html#exttarget https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Typolink.html#exttarget https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Typolink.html#t3-function-typolink-parameter ``` The link The first value is the destination of the link. It may start with: t3://: internal TYPO3 resource references. See Resource references for an in depth explanation on the syntax of these references. http(s)://: regular external links mailto:info@example.org: regular mailto links It's also possible to direct the typolink to use a custom function (a "link handler") to build the link. This is described in more detail below. ```
  12. Chris Müller commented on patch set 3 01/29/24, 18:55

    Reply

    Ah sorry, I got it wrong. Should not read patches after a long bike tour. Yes, of course, I am fine with that. But an example would be nice :-)
  13. Chris Müller uploaded patch set 4 CR +1 V +1 01/30/24, 18:54

  14. core-ci voted on patch set 4 V +1 01/30/24, 19:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52507

  15. Jörg Bösche voted on patch set 4 CR +1 03/25/24, 12:01

  16. Daniel Siepmann uploaded patch set 5 CR +1 V +1 04/24/24, 06:32

  17. Daniel Siepmann commented on patch set 5 04/24/24, 06:33

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

  19. Andreas Kienast commented on patch set 5 CR -1 04/24/24, 06:49

    Can you please move the ReST file to 13.2?
  20. Daniel Siepmann uploaded patch set 6 CR -1 V +1 04/24/24, 06:53

  21. Daniel Siepmann commented on patch set 6 04/24/24, 06:54

    Reply

    Sure, done.
  22. core-ci voted on patch set 6 V +1 04/24/24, 07:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56640

  23. Oliver Klee commented on patch set 6 04/24/24, 10:06

    Can we have tests for this (for the event getters and that the event is triggered and provided with certain data)?
  24. Daniel Siepmann commented on patch set 6 04/25/24, 06:03

    LinkFactory.php:328 Reply Unresolved

    Thanks for your help, we could get rid of this event by using the existing AfterLinkIsGeneratedEvent. It is a bit more code but works fine.
  25. Daniel Siepmann abandoned the change 04/25/24, 06:04

    The use case could be solved by using the existing AfterLinkIsGeneratedEvent insted.