fix: #3621475 Guard the reset HTMX URL generation against RouteNotFoundException

Issue: https://www.drupal.org/project/canvas_override/issues/3621475

Summary

menuLocalTasksAlter() generated a URL for the canvas_override.node.canvas.reset.do route without guarding against a stale router (e.g. newer module code deployed before the cache rebuild), so a RouteNotFoundException 500'd every page that rendered local tasks.

The URL generation is now wrapped in try/catch: on failure the HTMX wiring is skipped and the Reset tab degrades to its normal href (the standalone confirm form), while the Edit-template-tab permission gating below it still runs.

AI-Generated: Yes (fix authored with Claude Code; reviewed by Rajab Natshah.)

Checkpoints

  • File an issue about this project
  • Addition/Change/Update/Fix to this project
  • Testing to ensure no regression
  • Automated unit/functional testing coverage
  • Developer Documentation support on feature change/addition
  • User Guide Documentation support on feature change/addition
  • UX/UI designer responsibilities
  • Accessibility and Readability
  • Reviewed by a human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Update Release Notes
  • Release
Edited by Rajab Natshah

Merge request reports

Loading
Loading