Is there the ability to only check specific fields?

Example, I only want the Body field to be checked for broken links. No other text fields should be checked.

Thanks

Comments

hass’s picture

Not yet possible. Why should we implement this? It sounds not helpful.

StephenOTT’s picture

Use case: Drupal large scale migrations with enterprise clients you often run into the scenario where you are migrating multiple website content into the various content types. For recording keeping purposes we keep the "legacy" / original URL of where the content came from as a field on the node. So then when link checker runs its checks it checks this field and this field should not be checked. The user is alerted to a broken link that is not really "broken" because it is there for legacy purposes only.

There are multiple scenarios where we have come across the need for only specific fields to be checked.

Additionally it is helpful from a reporting perspective to be able to run reports against which fields have the broken links. (In large enterprise deployments you have the scenario where certain users are responsible for certain fields).

hass’s picture

Well, that is these one edgecase... I do not think this has anything to do with the size of your project or enterprise or not. Not sure why you save the old link... It looks not like something that you absolutly require to run your new website.

Function _linkchecker_parse_fields() should be the best place to skip the fields. We could add a setting into the field form.

Until today You are the second who is asking for these edge case solution. If you'd like to get this done by me you need to sponsor this feature.

hass’s picture

Status: Active » Closed (won't fix)

No feedback.

dshields’s picture

Status: Closed (won't fix) » Needs work

I think this would be a useful feature for exactly the reasons Stephen outlined. I'll take a stab at patching this over the next few days and contribute a solution back here.

dshields’s picture

This patch seems to take care of it.

This adds an option on every field's settings page to exclude that specific field from being scanned by Link Checker.

Please test and let me know if this is a decent solution to the challenge StephenOTT outlined above.

dshields’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: linkchecker-ignore_specific_fields-2299937-6.patch, failed testing.

dshields’s picture

Status: Needs work » Needs review
StatusFileSize
new2.29 KB

Oops. Bad formatting in patch in #6.

Hopefully, this passes

hankvanzile’s picture

Thanks, dshields! Patch #9 worked great for me and solved my use case perfectly.

dshields’s picture

Status: Needs review » Reviewed & tested by the community

  • VladimirAus committed 2fb17479 on 7.x-1.x authored by dshields
    Issue #2299937 by dshields, hass, StephenOTT, HankVanZile, VladimirAus:...
vladimiraus’s picture

Thank you for contributions. Committed! 🍻

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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