Problem/Motivation

The getRedirectByUrl() quietly ignores status codes that indicate an issue; specifically, the 404 status.
If we log these using the Tracking service, we'll can run a query against the logs to be able to get a list of all the 404s post-tidy

Steps to reproduce

Create (or edit) a page and add a link that points to a non-existent page to a supported field.
Run tidy for the page.

Proposed resolution

In getRedirectByUrl() add logging before returning FALSE (for a status that's not 200)

Test

Create a page with <a href="/a/path/that/results/in/404">404</a>

Run link magician on the parent page: drush link_magician:tidy nodeid --nodeid=NNNN
See the "Skipped" results (/admin/link_magician/tracking/results/skipped/{batchid}). You should see the message with the description "HTTP request unsuccessful (404)" for this link.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jasongose created an issue. See original summary.

jasongose’s picture

Title: Option for logging https return status when it's not 200 » Option for logging http return status when it's not 200
jasongose’s picture

Issue summary: View changes

jasongose’s picture

Status: Active » Reviewed & tested by the community
jasongose’s picture

Status: Reviewed & tested by the community » Needs review

(ugh... should have been moved to 'Needs review')

cameron prince’s picture

Status: Needs review » Reviewed & tested by the community

All tests pass and MR looks good. Marking RTBC.

jasongose’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jasongose’s picture

Status: Fixed » Closed (fixed)