Skip to content

fix(EXLM-5409): Enhancements to code updates to support Course versioning - #2853

Draft
Sakkala1016 wants to merge 1 commit into
mainfrom
exlm-5409
Draft

fix(EXLM-5409): Enhancements to code updates to support Course versioning#2853
Sakkala1016 wants to merge 1 commit into
mainfrom
exlm-5409

Conversation

@Sakkala1016

@Sakkala1016 Sakkala1016 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Please provide the Jira Issue your PR is for.

Jira ID: EXLM-5409

🤖 Auto-generated draft from Jira. Review before marking ready.

What was implemented

Added course-aware 404 handling in 404.html: when a bookmarked/linked course step, module, or certificate page returns a 404 because an author deleted the underlying content, the visitor is now redirected to the course landing page instead of seeing the generic "Page not found" screen. The fix reuses the existing pure getCourseFragmentUrl() helper from scripts/courses/course-utils.js to compute the course landing URL from the dead path, and verifies that URL still resolves before redirecting (falling back to the existing generic 404 otherwise) so it can't redirect into a second 404 or loop.

⚠️ Open Questions / Gaps

  • Redirect applies uniformly to all visitors, signed in or not — a real edge 404 means the existing signed-in-only redirect in blocks/module-info/module-info.js never runs anyway for this scenario, so this is additive rather than overlapping.
  • The query string from the dead URL is preserved onto the course-landing redirect; the path itself is not.
  • A second, related repro mentioned in the JIRA comments was never reproduced by the team and was explicitly tabled ("pick it back up if the need arises") — out of scope for this fix.
  • A manual redirects.json stopgap entry for the specific already-broken AJO example URL from the ticket is a content-authoring action, not a code change — flagging for the content team rather than implementing here.
  • No automated test infrastructure exists in this repo (no test/ directory, no test script) — this was verified manually: exercised the redirect decision logic (the same getCourseFragmentUrl + fetch check used in the fix) directly against the local dev server for a deleted-module/step path, a fully bogus course slug, an unrelated non-course 404, and the course landing page itself, confirming the expected redirect/no-redirect outcome in each case.

Test URLs:

AI Review Notes

  • The catch block in redirectToCourseIfDeleted intentionally swallows fetch/network errors silently, matching the existing silent-catch pattern already used in this same file's fetchAndParseHTML.

…ning

Redirect bookmarked/linked course step, module, and certificate pages to
the course landing page when the underlying content has been deleted by
authors, instead of showing the generic 404. Reuses the existing pure
getCourseFragmentUrl() helper from scripts/courses/course-utils.js to
compute the course landing URL from the dead path, verifies it still
resolves (avoiding redirect loops), and falls back to the existing
generic 404 UX for all other cases.

Resolves: EXLM-5409
@aem-code-sync

aem-code-sync Bot commented Aug 11, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant