Review main Merged

67039[BUGFIX] Mark broken links to hidden page and CEs

Sybille Peters CR +2 V +2 Easy +30 −9 updated 01/06/22, 18:34

Commit message

Broken links are marked in RTE by using the attribute
data-rte-error in the <a> tag, which results in a
special style and lets the link be visible as broken.

Previously this was not done for links to hidden pages
and links to content elements. These links were however
detected as broken by linkvalidator and displayed in
the list of broken links. Marking them in RTE as well
makes the behaviour consistent.

This patch ensures the consistency between the list
and the visual highlighting in RTE elements for links
to hidden pages and hidden content elements.

Highlighting links to hidden pages/content elements
on hidden pages may be visually relaxed to a notice
instead of an error in a dedicated patch as feature.

One PHP8.0 array key warning is fixed along the way.

Review

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

Issues 1

Files 3

Review log 3140

Show 1115 earlier messages
  1. Sybille Peters uploaded patch set 1 12/06/20, 16:23

  2. TYPO3com voted on patch set 1 V -1 12/06/20, 16:23 Completed build in 18s on Sun, 6 Dec, 04:23 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7867

  3. Sybille Peters uploaded patch set 2 12/06/20, 16:25

  4. Sybille Peters wrote 12/06/20, 16:25

    Topic set to Linkvalidator
  5. Sybille Peters updated the commit message in patch set 3 12/06/20, 16:33

  6. TYPO3com voted on patch set 2 V +1 12/06/20, 16:36 Completed build in 11m 02s on Sun, 6 Dec, 04:36 PM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7869

  7. TYPO3com voted on patch set 3 V +1 12/06/20, 16:43 Completed build in 09m 33s on Sun, 6 Dec, 04:43 PM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7871

  8. Benni Mack commented on patch set 3 11/03/21, 16:52

    CheckBrokenRteLinkEventListener.php:76

    what happens with $attributes here?
  9. Sybille Peters uploaded patch set 4 11/03/21, 19:40

  10. Sybille Peters commented on patch set 4 11/03/21, 19:43

    CheckBrokenRteLinkEventListener.php:76 Reply

    That was rubbish. Should be ok now though I am not entirely happy with the awkwardness of 2 database queries in the case of page links with fragment. Also one could argue whether broken links with fragment (to not existing content element) are indeed broken - but it least it is now consistent with what linkvalidator reports as broken.
  11. core-ci voted on patch set 4 V +1 11/03/21, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18822

  12. Sybille Peters commented on patch set 4 11/04/21, 16:34

    CheckBrokenRteLinkEventListener.php:76 Reply

    Done
  13. Benni Mack voted on patch set 4 CR +1 11/11/21, 16:01

  14. Nikita Hovratov commented on patch set 4 11/12/21, 14:26

    Works fine, one question though: What if I have a hidden page (working on new content for example). And inside this hidden page I link to another hidden page, that I am working on. Wouldn't it be annoying to see broken links there? My suggestion is, to not show internal broken links, if the page itself is hidden. Does this make sense?
  15. Sybille Peters commented on patch set 4 11/14/21, 12:20

    Reply

    @Nikita Good point. The question is also if you want to see broken links on hidden pages (content elements etc. ...) at all. That is configurable with: https://docs.typo3.org/c/typo3/cms-linkvalidator/master/en-us/Configuration/Index.html#checkhidden - so you can generally make sure that linkvalidator won't report broken links on hidden pages / and records in general. (This is what I am also doing on my site). What you are suggesting - I think you could argue both ways - before I activate a page, I might want to be able to see if it links to hidden pages. Or I just generally only get broken link information once the page is live. Also, is a link to a hidden page or a not hidden page and hidden CE element even an error? Because it won't be rendered in the FE if link is to hidden page. So, there are lots of questions there where you could argue either way. We may want to look at this again in v12 and make more configurable, that is what I would suggest. I also made a suggestion to be able to add markup to deactivate link checking per link. But that was rejected. Finding general rules that work for all is really difficult (or rather impossible), I think.
  1. Benni Mack updated the commit message in patch set 5 11/18/21, 10:49

  2. core-ci voted on patch set 5 V +1 11/18/21, 12:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19482

  3. Benni Mack wrote 11/29/21, 10:18

    Change destination moved from master to main
  4. Benni Mack updated the commit message in patch set 6 11/29/21, 14:07

  5. Benni Mack rebased onto patch set 7 12/18/21, 12:56

  6. core-ci voted on patch set 7 V +1 12/18/21, 13:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21237

  7. Stefan Bürk commented on patch set 7 12/23/21, 15:34

    Reply

    Not sure if this would be hard or easy, but maybe we can note that case not as broken per se, but more conservative -> linking to an existing but hidden pate ? not es an error, more as a "warning/notice" ?
  8. Stefan Bürk uploaded patch set 8 01/06/22, 11:48

  9. Stefan Bürk commented on patch set 8 V +1 CR +1 01/06/22, 11:54

    Reply

    I would suggest use this bugfix to ensure the consistency between the list and the visual highlighting in the RTE field, even if highlighting it as 'error' may be a little bit hard/strict in some cases, it is better than having no hightlighting at all. Highlichting some cases as 'notice' or some kind of releaxed visual style can be discussed and implemented as feature in a dedicated patch. Nikita & Sybille, would you both align with this suggestion, so we can get this as first bugfix and first step in ?
    Thanks for this patch Sybille.
  10. core-ci voted on patch set 8 V +1 01/06/22, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21691

  11. Sybille Peters commented on patch set 8 01/06/22, 12:07

    Reply

    Yes, I agree with suggestions made by Stefan: to keep this issue as "bugfix" and address the questions Nikita raised as a followup and a separate "feature" patch.
  12. Nikita Hovratov uploaded patch set 9 01/06/22, 13:38

  13. Nikita Hovratov commented on patch set 9 V +1 CR +1 01/06/22, 13:42

    About the todo: For the core these are always integers, yes. But there are some extensions, that implement speaking fragments like: https://extensions.typo3.org/extension/content_slug Better to treat it as a string, maybe the core will provide speaking fragments/sections in the future as well. Thanks Sybille! And Stefan: Please revote. I just removed extra parenthesis and the todo I was talking about.
  14. Stefan Bürk commented on patch set 9 V +1 CR +1 01/06/22, 13:50

    Reply

    Thanks Nikita. Regarding the todo removable and the hint, ACK. Also the parenthesis removal.
  15. core-ci voted on patch set 9 V +1 01/06/22, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21699

  16. Stefan Bürk commented on patch set 9 01/06/22, 14:02

    Reply

    Done
  17. Stefan Bürk commented on patch set 9 V 0 CR -1 01/06/22, 15:03

    -1 temp: will try to get rid of that abandonded relation chain, not sure if this would be an "issue" for merging.
  18. Stefan Bürk voted on patch set 9 V +1 CR +1 01/06/22, 16:10

  19. Sybille Peters rebased onto patch set 10 01/06/22, 16:19

  20. Stefan Bürk voted on patch set 10 V +1 CR +1 01/06/22, 16:22

  21. core-ci voted on patch set 10 V +1 01/06/22, 16:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21718

  22. Benni Mack voted on patch set 10 V +1 CR +1 01/06/22, 16:44

  23. Nikita Hovratov voted on patch set 10 V +1 CR +1 01/06/22, 16:51

  24. Benni Mack voted on patch set 10 V +2 CR +2 01/06/22, 18:34

  25. Benni Mack merged patch set 11 01/06/22, 18:34