-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site editor: redirect to main page menu if page record not found #56177
Conversation
…een found, probably deleted.
Size Change: +891 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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.
Confirmed this hangs on trunk:
On this branch confirmed that there is no hang, and it directs to a different page. One issue -- what page is it redirecting to? It isn't the first page in the list, and I don't even see it in the left menu (I have a lot of dummy pages). Could we select the first page?
Screen.Recording.2023-11-17.at.1.35.22.PM.mov
Thanks for testing. It should just open the Pages list and load the home template, which is the default behaviour when opening this view ( So the screen recording in this comment is expected.
That's possible. It would depart from the default behaviour, so I'd say if we selected the first page on a 404 redirect, maybe we should do the same when landing on |
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.
This all makes sense, it loaded the home page view for me. I didn't recognize it because of all the dummy content I'd loaded on the site. I think this is good as is. 👍
What?
This is a test. It might not work.
This PR redirects to
/page
when a record has resolved but has not been found, probably deleted.2023-11-16.09.18.24.mp4
Why?
At the moment the site editor will hang if it tried to load an entity that does not exist.
This applies also for templates etc, but starting with pages to test out the approach.
How?
Pushing an entry to the history.
TODO
Add E2E test
Testing Instructions
Try to navigate to a page that has been deleted, e.g.,
/wp-admin/site-editor.php?postType=page&postId=37&canvas=edit
Even better, create a page and navigate to the site editor > pages.
Delete the page in another tab, then back in the site editor, try to open that page.
Observe that you're redirected to
/pages
.Check that loading existing pages works!