#84990Check for other broken link types in RteHtmlParser
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):
- 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)
Images
Current situation:
!broken-links1.png!
broken-links2.png
Solution
With the suggested solution all broken links will be marked!:
rte.png