-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block templates: Recognize and convert old or derivative block types to their canonical form #26147
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
Block templates: Recognize and convert old or derivative block types to their canonical form #26147
Conversation
|
Size Change: +1.32 kB (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
mcsf
left a comment
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 looking at this. The general approach seems right.
|
I wonder if we could tweak one of the E2E tests that we have, e.g. Now, this only fixes the issue of templates not having their blocks converted from deprecated types (e.g. |
|
Thanks for reviewing @mcsf - very valuable feedback as always 💯
Since I wanted to get feedback about the approach I'll improve the implementation and add tests for sure and address the other feedback as well.
There was a relevant issue about handling the error better here: #21718, which I closed as there was a better error msg and handled earlier. This still results in WSOD though. I think it's a separate issue and I'm not really sure what the best approach of this would be to be honest. |
Either reopen that issue or make a more specific one — both are fine.
The editor is already equipped to handle unknown blocks if they are loaded from |
I'll open a new one. Thanks for the context too! |
|
The other thing is looking at how we're using |
gziolo
left a comment
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.
Nice one, I only skimmed but it's definitely a good direction 👍
Description
Fixes: #26137
If a post type template contains a legacy block, like an
embedfor a specific platform (e.g.core-embed/wordpress-tv), the editor will crash with a WSOD when trying to create a new post.Steps to reproduce exist in issue.
Checklist: