Epic #85006: Epic: Improve broken link handling in TYPO3 / linkvalidator rewrite
Check for other broken link types in RteHtmlParser
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.
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).
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):
- Add hooks in HtmlRteHtmlParser::markBrokenLinks for each linktype to call a link check function
- 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.)
- 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)
With the suggested solution all broken links will be marked!:
#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