-
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: Fix BlockPreview in Template panel when editing a page #53550
Conversation
Size Change: +36 B (0%) Total Size: 1.5 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.
Thanks for the quick fix @noisysocks 🚀
✅ Could replicate original issue
✅ Preview displays correctly after applying this PR
✅ Follows same approach as #52899
✅ Feature's updated e2e spec passes locally (GitHub is still running)
LGTM!
Before | After |
---|---|
Flaky tests detected in 14273ec. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5827886985
|
@@ -34,7 +35,7 @@ export default function EditTemplate() { | |||
queryArgs | |||
), | |||
title: template?.title, | |||
blocks: template?.blocks, | |||
content: template?.content, |
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.
I think we should retrieve both blocks and content and prefer blocks if defined otherwise, you'll get an outdated preview.
What?
Fixes the
BlockPreview
that appears in the sidebar's Template panel when editing a page in the site editor.Why?
It went missing as a result of #52417 removing the
blocks
attribute from the object retuned bygetEditedEntityRecord
.How?
The fix is identical to #52899. We simply
parse()
content
ourselves.Testing Instructions
I added a regression assertion to this feature's E2E spec.
To test manually:
Screenshots or screencast