feat: #3636905 List published pages that return an error in earkiv-published-errors.csv

Closes https://www.drupal.org/project/earkiv/issues/3636905

What it does

With Include all published content, published pages that return an error and that no page links to were left out of earkiv-broken-links.csv (they are not broken links) and earkiv-unlinked-pages.csv (they are not in the archive). They are now written to earkiv-published-errors.csv in the root of the archive:

  • Columns: nid, langcode, type, title, url, status (HTTP status, or a negative HTTrack error code), sorted by node and language.
  • The file is only created when there are such pages, and Drush prints Found N published pages that returned an error, listed in earkiv-published-errors.csv.
  • handleErrorPages() now returns the status of each published URL that returned an error; listPublishedErrors() writes the list.
  • Published pages that some page links to stay in earkiv-broken-links.csv as before.
  • The README mentions the file and the common cause: a + in the path alias, which Drupal decodes as a space, so the page only works as %2B while HTTrack fetches it with +.

Testing

A small mirror with four published pages:

Page Result
/grants/erasmus%2B/assessment, 404, not linked (logged by HTTrack with +) In earkiv-published-errors.csv with 404
/hidden, 403, not linked In earkiv-published-errors.csv with 403
/linked, 404, linked from /a In earkiv-broken-links.csv as before
/a, 200 In neither list

In a full archive of a Drupal 11 site, two pages with + in their alias returned 404 and were only visible as a count in the Drush output; they would now be listed. phpcs (Drupal, DrupalPractice) reports no new findings compared with 1.0.x.

AI-Generated: Yes (Used Claude Code to write the change, test it and write this merge request.)

Merge request reports

Loading
Loading