Repository navigation
ignore page revision parameter when page id is 404 - #460
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes uncaught errors during 404 fallback by making the page loader ignore Sequence diagram for page revision 404 fallbacksequenceDiagram
participant Request
participant Page
participant Model
Request->>Page: load()
Page->>Page: handlePage(pageId)
Page->>Page: getPageRecord(pageId)
alt page_revision exists and pageId is not 404
Page->>Model: load page revision
Model-->>Page: revision not found
Page-->>Page: throw NotFoundHttpException
Page->>Page: handlePage(404)
else pageId is 404
Page->>Model: getPage(404)
Model-->>Page: 404 page record
Page-->>Request: render regular 404 page
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
tijsverkoyen
approved these changes
Oct 29, 2026
jonasdekeukelaere
approved these changes
Oct 29, 2026
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.
Type
Resolves the following issues
A request with a
page_revisionparameter that doesn't match an existing revision results in an uncaughtNotFoundHttpException("No page was found for the page id:404") instead of the regular 404 page.Pull request description
Cause
Page::getPageRecord()ignores$pageIdwhenpage_revisionis present in the URL and loads that revision instead:Page::load()callshandlePage()with the page id from the URL.getPageRecord()seespage_revisionand loads the revision. It doesn't exist, sohandlePage()throws aNotFoundHttpException.load()catches it and retries withhandlePage(404)to render the 404 page.page_revisionis still in the URL, sogetPageRecord()ignores the 404 id again and looks up the samenon-existing revision.
handlePage()throws a secondNotFoundHttpException. This one happens inside thecatchblock, so nothingcatches it.
Fix
Skip the revision lookup when the 404 page itself gets loaded, so the fallback always uses the regular 404 page
Summary by Sourcery
Bug Fixes: