I noticed that the same construction that builds the error message is repeated multiple times in the code. E.g.
format_plural($link->fail_count, 'Link check of <a href="@url">@url</a> failed once (status code: @code).', 'Link check of <a href="@url">@url</a> failed @count times (status code: @code).', array('@url' => $link->url, '@code' => $link->code))

1. I believe the same construction within the code should be delivered with the separate function.
2. For some cases, e.g. ability to scroll page to the place in WYSIWYG editor that has that broken link, there might be the altering option needed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skullhole created an issue. See original summary.

skullhole’s picture

Here's the patch.

hass’s picture

Why should I implement this?

hass’s picture

Category: Feature request » Support request
Status: Active » Fixed
skullhole’s picture

@hass

Based on the idea - if you have to do something twice in code you should have the function to do it. I refer to the similar message being built in many places.

drupal_get_messages() can do the trick, but it does not provide the context: getting the messages you at first need to intelligently "catch" the linkchecker message, and then extract/parse the data from the message and then alter it.
Despite the fact it it is possible to do I believe it is more natural and drupal'ish to have the alter process instead of playing with the final output.

hass’s picture

Since translatable strings are unique it should be quite easy to extract the ones you'd like to alter and than change them.

I do not think this is common and there are already modules that allow you changing translatable strings - also in english. Implementing something here is absolutly not required.

See https://www.drupal.org/project/stringoverrides

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.