-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Site Editor should display a 404 message #69009
base: trunk
Are you sure you want to change the base?
Conversation
Add a new "notfound" route to the site editor routes
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +158 B (+0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in d89b362. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13112860647
|
@jsnajdr, @youknowriad, can you look at this when you have time? I'm not very familiar with Routes API. |
The routing aspect look good to me. |
This solution doesn't add knowledge of "no route found" to the router library though but it doesn't bother me much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @carolinan!
I wasn't able to figure out how to do it. I hope it doesn't cause any future problems. |
I'm not sure I can give feedback on the design, but the text and layout seem good enough to me for now 😅 |
What?
Closes #67445
This PR displays a 404 Not Found message when a user visits a Site Editor screen that does not exist.
It adds a new route to the edit site package, based on the comments on
#67773
Why?
A 404 message was missing.
How?
This PR adds a new route called
notFoundRoute
to the edit site package.It uses
*
as the value for thepath
, with the intention to catch, well, everything that isn't already on another existing route.The
sidebar
uses the main navigation screen sidebar, so that it is easy for users to navigate away from the 404.The 'content' Is a translatable text: __( '404 (Not Found)' ).
Agreed, the message is nothing fancy, It could be a larger text and centered.
Testing Instructions
Activate a block theme.
Navigate back and forward around the existing screens to look for any regressions.
Try navigating to wp-admin/site-editor.php?p=%2Ftemplate-fdgfdgdfg. The 404 message should show.
Screenshots or screencast