-
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
Page List: Add extra safety around warnings. #47603
Conversation
Size Change: +36 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1e1a4d0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4052776152
|
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.
LGTM. Thanks for fixing it.
What?
See #46930 (comment).
It's possible to get the page list to throw an error when the user has a particular page structure as the code doesn't check if
parentPageDetails.title.rendered
is defined before attempting to access it.How?
The fix is to add some extra safety to the warning message.
I've also added an extra message, as otherwise the block renders completely empty.
Testing Instructions
This PR: A notice displays "Page List: Cannot retrieve Pages."
In trunk: The block throws an error.
Screenshots or screencast
Before
After