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.
Issue fork link_magician-3586075
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
Comment #2
jasongose commentedComment #3
jasongose commentedComment #5
jasongose commentedComment #6
jasongose commented(ugh... should have been moved to 'Needs review')
Comment #7
cameron prince commentedAll tests pass and MR looks good. Marking RTBC.
Comment #8
jasongose commentedThanks!
Comment #10
jasongose commented