In _linkchecker_add_[node|comment|box]_links(), _linkchecker_cleanup_*_references() is never executed when $links is empty. So when there used to be links in a node, but the user removes all of them, _linkchecker_cleanup_*_references() is not called and the link references remain in the linkchecker_[node|comment|box] tables. This results in invalid entries in the Broken Links list.

It's probably enough to just place the calls to _linkchecker_cleanup_*_references() outside the if (!empty($links)) {} block to fix this?

Comments

hass’s picture

Yeah, looks wrong... may need to be moved the bottom of the function and outside the if.

The cron cleanup will do this job otherwise after some time... aside - I need to re-think if the cron stuff could be removed now, too.

wimh’s picture

The cron cleanup will do this job otherwise after some time...

It doesn't seem like the cron job will re-scan content, so how can it do this? It only removes link references for links that are no longer there (_linkchecker_cleanup_*_references). But to me it seems it should be the other way round: references (in linkchecker_[box|node] are populated by the content scanning, and links (in linkchecker_links) no longer having any references can be removed in cron?

hass’s picture

Oh, yes... sorry for confusion.

hass’s picture

Status: Active » Fixed
hass’s picture

Status: Fixed » Needs work
hass’s picture

Status: Needs work » Fixed

Should be fixed now.

Status: Fixed » Closed (fixed)

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