-
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
Template Part: Fix site editor error when loading with list view set to always display #58868
Template Part: Fix site editor error when loading with list view set to always display #58868
Conversation
…to always display
Size Change: +3 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in 71087df. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7838377238
|
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 this! Loading the site editor with list view always visible no longer errors.
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. |
Thanks for the quick review! 🙇 |
Thank you, @andrewserong! |
What?
Follows #58644
Fix a site editor error when opening the site editor with the list view set to always display ("Always open list view" in preferences)
Why?
When initially loading, until an entity object is properly resolved, the entity object appears to be an empty object, so
capitalCase
was being called withundefined
which throws an error.How?
If
entity.slug
is not present, fallback to an empty string to avoidcapitalCase
throwing an errorTesting Instructions
In the site editor, open the preferences and set
Always open list view
and then do a full page reload the site editor in canvas mode, i.e:/wp-admin/site-editor.php?canvas=edit
On
trunk
if your template has Header or Footer template parts, there'll be an error.With this PR applied there should be no error
Testing Instructions for Keyboard
Screenshots or screencast
The error: