Feature #84990

Check for other broken link types in RteHtmlParser

Added by Sybille Peters over 1 year ago. Updated 26 days ago.

Status:
Resolved
Priority:
Should have
Category:
Linkvalidator
Target version:
-
Start date:
2018-05-12
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Problem

Currently, RteHtmlParser::markBrokenLinks checks only for broken page links and marks them accordingly. This makes usage of Linkvalidator very tedious, because the RTE edit form is opened by clicking on the edit icon in the list of broken links and then the user has no context whatsover which of the (possibly) several links in the edit field he should fix.

Since the functionality of marking broken page links is already implemented in TYPO3, it seems ideal to use this feature and extend it to improve the usability of Linkvalidator by providing this feature for all links.

Possible considerations

If a link check is executed on each external link and file link etc. it means one extra DB query for each link on opening RTE. It might be a good idea to use already existing link cache in ExternalLinkTypes (todo).

Possible solution

If linkvalidator is installed and broken links records are available, the broken external links could be marked in the same fashion.

Also file links and other links could be considered.

This would not only make fixing broken links using the linkvalidator much easier, but would also make this information available whenever a record is edited.

Implement like this (see patch in Gerrit: https://review.typo3.org/56947):

  1. Add hooks in HtmlRteHtmlParser::markBrokenLinks for each linktype to call a link check function
  2. In Linkvalidator: connect to these hooks and check the tx_linkvalidator_link table for already detected broken links (information about all broken links will be in that table, can be done for external links, file links etc.)
The hooks should be called whenever the RTE editor is opened, if
  • It is configured as $GLOBALS['TYPO3_CONF_VARS']['RTE']['checklinkmode'] == 'full' (new configuration field)
  • OR if the RTE editor is opened from the Linkvalidator list of broken links (this is a todo)

Images

Current situation:


Solution

With the suggested solution all broken links will be marked!:

rte.png View (14.8 KB) Sybille Peters, 2018-05-25 22:27

broken-links2.png View (76.8 KB) Sybille Peters, 2018-05-31 12:12

broken-links1.png View (24.2 KB) Sybille Peters, 2018-05-31 12:14


Related issues

Related to TYPO3 Core - Bug #84987: Add css style for broken page links in ckeditor Closed 2018-05-12
Related to TYPO3 Core - Feature #84704: Linkvalidator: Open edit form for specific field in record (,not entire record) when fixing links Closed 2018-04-12

Associated revisions

Revision 0d77450b (diff)
Added by Sybille Peters 29 days ago

[FEATURE] Mark broken external links in RTE

Before this change, only broken page links were marked
in RTE.

In general: If a broken link is to be marked in the RTE, extra
markup is automatically added by the transform db -> RTE function.
This will cause the broken link to stand out (yellow background
with red border).

With this patch the behaviour was extended to marking "external"
links as well. External links are checked by linkvalidator, using
existing linkvalidator table of broken links

In order to enable the external link checking, a new PSR-14 Event
has been defined. This makes the behaviour consistent and
configurable.

The link checking can also be done by other external extensions
using the introduced Event.

Performance considerations:

If installed, linkvalidator is used to check external links.
The implementation does not do the external link checking on
the fly by submitting a HTTP request to external webservers,
but uses the information already gathered in linkvalidator
tx_linkvalidator_link table instead. Thus, one DB query is
necessary for each link that is checked.

Resolves: #84990
Releases: master
Change-Id: Ic5992ab6238449b43b5c243dc0c45527ed9d0b48
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947
Tested-by: Daniel Goerz <>
Tested-by: TYPO3com <>
Tested-by: Jonas Eberle <>
Tested-by: Daniel Gorges <>
Tested-by: Benni Mack <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Daniel Gorges <>
Reviewed-by: Benni Mack <>

Revision 7378035e (diff)
Added by Sybille Peters 27 days ago

[FEATURE] Mark broken file links in RTE

Broken file links are now marked in RTE with yellow background and red
border.

This patch uses the previously introduced event
:php:`BrokenLinkAnalysisEvent`.

The broken links are only detected if linkvalidator is installed and
has checked for broken links (e.g. via scheduler).

Resolves: #84990
Releases: master
Change-Id: Iddebe7f9358901c70f90f9751298ce2905684662
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091
Tested-by: Daniel Goerz <>
Tested-by: TYPO3com <>
Tested-by: Sybille Peters <>
Tested-by: Riccardo De Contardi <>
Tested-by: Susanne Moog <>
Reviewed-by: Sybille Peters <>
Reviewed-by: Benni Mack <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Sybille Peters over 1 year ago

  • Related to Bug #84987: Add css style for broken page links in ckeditor added

#2 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#4 Updated by Sybille Peters over 1 year ago

  • Subject changed from Check for broken external links in RteHtmlParser to Check for other broken link types in RteHtmlParser
  • Description updated (diff)

#5 Updated by Sybille Peters over 1 year ago

  • Description updated (diff)

#6 Updated by Sybille Peters over 1 year ago

  • Parent task set to #85006

#7 Updated by Sybille Peters over 1 year ago

  • Category changed from RTE (rtehtmlarea + ckeditor) to Linkvalidator

This could probably be better handled only in Linkvalidator itself using the already existing hook: `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][detectbrokenlinks]` to override markBrokenLinks

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#12 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#13 Updated by Sybille Peters over 1 year ago

  • Related to Feature #84704: Linkvalidator: Open edit form for specific field in record (,not entire record) when fixing links added

#14 Updated by Sybille Peters over 1 year ago

  • Description updated (diff)

#15 Updated by Sybille Peters over 1 year ago

#16 Updated by Sybille Peters over 1 year ago

#17 Updated by Sybille Peters over 1 year ago

  • Target version set to next-patchlevel

#18 Updated by Sybille Peters over 1 year ago

  • Target version deleted (next-patchlevel)

#19 Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#20 Updated by Gerrit Code Review about 1 year ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58669

#21 Updated by Gerrit Code Review about 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#22 Updated by Gerrit Code Review about 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#23 Updated by Gerrit Code Review about 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56947

#24 Updated by Gerrit Code Review 3 months ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#25 Updated by Gerrit Code Review 3 months ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#26 Updated by Gerrit Code Review 3 months ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#27 Updated by Gerrit Code Review 3 months ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#28 Updated by Gerrit Code Review 3 months ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#29 Updated by Gerrit Code Review about 1 month ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#30 Updated by Gerrit Code Review about 1 month ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#31 Updated by Gerrit Code Review about 1 month ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#32 Updated by Gerrit Code Review about 1 month ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#33 Updated by Gerrit Code Review about 1 month ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#34 Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#35 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#36 Updated by Gerrit Code Review about 1 month ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#37 Updated by Gerrit Code Review about 1 month ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#38 Updated by Gerrit Code Review about 1 month ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#39 Updated by Gerrit Code Review about 1 month ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#40 Updated by Gerrit Code Review about 1 month ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#41 Updated by Gerrit Code Review about 1 month ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#42 Updated by Gerrit Code Review about 1 month ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#43 Updated by Gerrit Code Review about 1 month ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#44 Updated by Gerrit Code Review about 1 month ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#45 Updated by Gerrit Code Review about 1 month ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#46 Updated by Gerrit Code Review 30 days ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#47 Updated by Gerrit Code Review 30 days ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#48 Updated by Gerrit Code Review 29 days ago

Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#49 Updated by Gerrit Code Review 29 days ago

Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#50 Updated by Gerrit Code Review 29 days ago

Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/56947

#51 Updated by Sybille Peters 29 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#52 Updated by Gerrit Code Review 29 days ago

  • Status changed from Resolved to Under Review

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#53 Updated by Gerrit Code Review 27 days ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62091

#54 Updated by Sybille Peters 27 days ago

  • Status changed from Under Review to Resolved

#55 Updated by Sybille Peters 26 days ago

  • Parent task deleted (#85006)

Also available in: Atom PDF