fix(EXLM-5409): Enhancements to code updates to support Course versioning - #2853
Draft
Sakkala1016 wants to merge 1 commit into
Draft
fix(EXLM-5409): Enhancements to code updates to support Course versioning#2853Sakkala1016 wants to merge 1 commit into
Sakkala1016 wants to merge 1 commit into
Conversation
…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
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 puregetCourseFragmentUrl()helper fromscripts/courses/course-utils.jsto 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.blocks/module-info/module-info.jsnever runs anyway for this scenario, so this is additive rather than overlapping.redirects.jsonstopgap 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.test/directory, no test script) — this was verified manually: exercised the redirect decision logic (the samegetCourseFragmentUrl+ 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:
Before: https://main--exlm--adobe-experience-league.aem.live
After: https://exlm-5409--exlm--adobe-experience-league.aem.live
After: https://exlm-5409--exlm--adobe-experience-league.aem.live/en/courses/ajo-design-and-manage-journeys-and-action-campaigns?martech=off
After: https://exlm-5409--exlm--adobe-experience-league.aem.live/en/courses/ajo-design-and-manage-journeys-and-action-campaigns/deleted-module-example/step-1?martech=off
After: https://exlm-5409--exlm--adobe-experience-league.aem.live/en/browse?martech=off
After: https://exlm-5409--exlm--adobe-experience-league.aem.live/en/docs?martech=off
After: https://exlm-5409--exlm--adobe-experience-league.aem.live/en/search?martech=off
AI Review Notes
redirectToCourseIfDeletedintentionally swallows fetch/network errors silently, matching the existing silent-catch pattern already used in this same file'sfetchAndParseHTML.