Review main Abandoned

58669[FEATURE] Make broken link checking configurable in RTE

Sybille Peters CR 0 V 0 Hard +244 −10 updated 10/21/18, 15:29

Commit message

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

In general: If a broken link is to be marked in the RTE, extra
markup is added, which will cause the broken link to stand out
(yellow background with red border).

With this patch, the behaviour is more configurable:

1) The general behaviour can be configured in the Yaml configuration
   for RTE (markBrokenLinksMode).
2) If markBrokenLinksMode is set to 'hook', existing hooks will
   get executed
3) New hooks $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']
   ['rte']['transformation']['checklink'][$type] introduced, where
   $type is the link type (e.g. 'page', 'external', etc.)
4) The route record/edit gets extra parameter markBrokenLinksMode
   which can be used to override the configuration of RTE.
   This option is used in linkvalidator

By default, markBrokenLinksMode is set to default, which means
only page links are checked (like before this patch).

Only when the RTE is opened by editing a record from the linkvalidator
list, is this always set to 'hook' mode, which currently causes
external links to be marked as well. Always marking broken
links when using the RTE for linkvalidator makes fixing broken
links much easier and improves usability of linkvalidator.

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

Performance considerations:

- In this patch, linkvalidator is used to check external links.
  The hook implementation does not do the external link checking on
  the fly, but uses the information already gathered in linkvalidator
  tables. Thus, one DB query is necessary for each link that is checked.
  External link checking (by curl) is not performed.

Other link types:
- currently, page and external links are checked
- file link checking can be added as well with another patch

Resolves: #84990
Releases: master
Change-Id: Ic5992ab6238449b43b5c243dc0c45527ed9d0b48

[BUGFIX|TASK|WIP]

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Files 13