Review main Merged

79698[BUGFIX] Consider path links with leading slash as `url`

Stefan Bürk CR +2 V +2 Hard +403 −507 updated 03/11/24, 08:42

Commit message

`ext:redirects` allowed to redirect to absolute target
path. With #97159 the target field TCA type has changed
and did not allowed to enter a path identifier since then.

This change lets the `LinkService` resolve a path identifier
not matching a file or folder as type `URL` and restore the
ability to create path based redirect target links.

Additionally, it's now possible again to link directly `/`
again in link fields or RTE fields (#97693).

The underlying solution is that "old-school" links to files
(before FAL) to e.g. "fileadmin/mydownload.exe" is now
actually treated as an external URL, and not as a automatically
detected file anymore.

Review

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

Issues 3

Files 10

Review log 2738

Show 713 earlier messages
  1. Stefan Bürk uploaded patch set 1 07/04/23, 11:44

  2. Oliver Klee commented on patch set 1 07/04/23, 11:48

    Is the issue number still missing here?
  3. core-ci voted on patch set 1 V +1 07/04/23, 11:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43372

  4. Stefan Bürk updated the commit message in patch set 2 V +1 07/04/23, 12:55

  5. core-ci voted on patch set 2 V +1 07/04/23, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43380

  6. Benni Mack uploaded patch set 3 V +1 07/04/23, 16:15

  7. core-ci voted on patch set 3 V -1 07/04/23, 16:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43403

  8. Benni Mack uploaded patch set 4 V -1 07/04/23, 18:20

  9. core-ci voted on patch set 4 V -1 07/04/23, 18:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43417

  10. Benni Mack commented on patch set 5 V -1 07/04/23, 19:10

    Published edit on patch set 4.
  11. core-ci voted on patch set 5 V -1 07/04/23, 19:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43419

  12. Stefan Bürk uploaded patch set 6 V -1 07/05/23, 07:38

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

  1. Oliver Klee commented on patch set 6 07/05/23, 07:54

    Reply

    Done
  2. Stefan Bürk uploaded patch set 7 V -1 07/05/23, 08:02

  3. core-ci voted on patch set 7 V +1 07/05/23, 08:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43469

  4. Oliver Klee wrote 07/05/23, 08:15

    Removed cc Oliver Klee.
  5. Oliver Klee voted on patch set 7 V +1 07/05/23, 08:16

  6. Oliver Klee commented on patch set 7 07/05/23, 08:18

    LegacyLinkNotationConverter.php:222

    $fileOrFolderObject is an object or null here, not a boolean. To make this more obvious to the reader (and to help static code analysis), I propose we change this to `if ($fileOrFolderObject instanceof … && …`.

    UrlLinkHandler.php:52

    If we have this, we can drop the condition above - because if it starts with two slashes, it also starts with one slash. :-)
  7. Stefan Bürk uploaded patch set 8 V +1 07/05/23, 08:49

  8. Stefan Bürk commented on patch set 7 07/05/23, 08:49

    LegacyLinkNotationConverter.php:222 Reply

    Wouldn't be an `!== null`enough ? instead of multiple instance checks then ?

    UrlLinkHandler.php:52 Reply

    Done
  9. Stefan Bürk uploaded patch set 9 07/05/23, 08:53

  10. core-ci voted on patch set 8 V +1 07/05/23, 08:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43472

  11. Oliver Klee voted on patch set 9 CR +1 07/05/23, 08:59

  12. Stefan Bürk uploaded patch set 10 CR +1 07/05/23, 09:05

  13. core-ci voted on patch set 9 V +1 07/05/23, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43473

  14. Oliver Klee commented on patch set 10 CR +1 07/05/23, 09:12

    LegacyLinkNotationConverter.php:222 Reply

    Done
  15. core-ci voted on patch set 10 V +1 07/05/23, 09:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43476

  16. Oliver Klee voted on patch set 10 V +1 07/05/23, 09:31

  17. Oliver Hader commented on patch set 10 07/05/23, 10:27

    pages-and-ttcontent.xml:79

    I don't know whether this will work (without having it tested). Previously the reference was defined by `db` and the target `sys_file:4` - now it's just `external` and `4` → thus, there does not seem to be any hint anymore, that it actually would be a file... I might be, that is not relevant anymore - however, I just don't know - this would have to be tested manually again.
  18. Benni Mack updated the commit message in patch set 11 CR +1 V +1 07/05/23, 10:30

  19. core-ci voted on patch set 11 V +1 07/05/23, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43483

  20. Oliver Hader commented on patch set 11 07/05/23, 10:44

    pages-and-ttcontent.xml:79 Reply

    In my manual test (export) it looks like this: ``` <rec index="516" type="array"> <uid>516</uid> <pid>401</pid> <title>Test</title> <relations index="rels" type="array"></relations> <softrefs type="array"> <softref_element index="header_link:typolink:463f336836889120d6205bbbad342319:0" type="array"> <field>header_link</field> <spKey>typolink</spKey> <matchString>file:230</matchString> <subst type="array"> <type>db</type> <recordRef>sys_file:230</recordRef> <tokenID>463f336836889120d6205bbbad342319</tokenID> <tokenValue>file:230</tokenValue> </subst> </softref_element> </softrefs> </rec> ```
  21. Oliver Hader commented on patch set 11 V +1 CR +1 07/05/23, 12:21

    pages-and-ttcontent.xml:79 Reply

    Reason is, that `file:4` is used as field value (instead of using the absolute path `/foo/filename.png`...
  22. Benni Mack voted on patch set 11 V +1 CR +1 07/05/23, 12:33

  23. Stefan Bürk voted on patch set 11 V +2 CR +2 07/05/23, 12:38

  24. Stefan Bürk merged patch set 12 07/05/23, 12:39

  25. Josef Glatz commented on patch set 12 03/11/24, 08:42

    Unresolved

    Looks like the backport for 12.4 of this patch is not working anymore. I've updated the issue status therefore in forge. Hope this is ok, otherwise I will create a new issue @benni@typo3.org @stefan@buerk.tech