-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Critical editor failure after placing empty Classic editor in a container block #17138
Comments
Hello @QuietNoise. Thank you for your report. I can confirm the bug. WP Version: 5.3-alpha-45282-src I'll try to see if I can request a PR fix later. |
Notes: If an empty "Classic Editor" is saved in the "root" (not inside a column), it won't be saved. The <!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":33.33} -->
<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:freeform /--></div>
<!-- /wp:column -->
<!-- wp:column {"width":66.66} -->
<div class="wp-block-column" style="flex-basis:66.66%"></div>
<!-- /wp:column --></div>
<!-- /wp:columns --> I supposed we can either just make it so that I'm quite new to Gutenberg so it would take me more time before I can produce a fix. |
This issue was closed by #17164 in the sense that the PR prevents the editor from crashing when handling nested empty freeform blocks. However, with that fix the editor will disregard any empty freeform block present in a nested context. Adding support for this could be achieved by tweaking the serialiser per #17164 (comment), if this is still deemed a pertinent fix. I don't feel strongly about supporting persistent empty freeform blocks, but any interested parties should open an issue if they feel otherwise. |
Cool. Glad that the fix for the breaking part went through. @mcsf I have some use cases for keeping empty Classic editor as is which you might consider:
While the first use case is something most people can live without then in second case removing something that a developer or content supervisor deliberately placed in seems against smooth UX experience. Also 2nd use case will prevent non savvy users from properly filling the content as they will not know where and if there was a Classic editor meant to be in a given container. Second, I reckon the behaviour will be inconsistent / confusing in a way that empty Classic blocks placed as roots won't disappear while empty Classic blocks from Column / Groups will. |
Thanks for the detailed reply, @QuietNoise.
If you don't mind my asking, how often do you do this with Classic blocks? While there's nothing wrong with using Classic blocks in nested contexts, it's surprising to me, since they were mainly conceived as a way of providing a smooth path from old editor to new editor with blocks doing the work for you. Secondary question, also out of curiosity: have you ever overridden the editor's configuration to use some other block type that isn't Classic as Freeform?
I agree with all these arguments in principle.
If you don't mind, I'd love it if you could open the issue. Feel free to copy-paste some of what's been discussed here, and point to this issue and mention me if you like. Thanks! |
Describe the bug
After placing an empty Classic block in a container (Column, Group) and leaving the edit page the said edit page is no longer accessible. Returning to the affected edit page results in a soft White Screen Of Death.
When accessing the crashed edit page the Developer Tools Console will show an error:
Uncaught (in promise) TypeError: Cannot read property 'name' of undefined
with callstack pointing to Gutenberg build.
To reproduce
Expected behavior
I would expect the edit page to be accessible regardless whether the content in Classic editor is present or not.
Other notes
There is no apparent way to recover the page you are editing other than creating it from scratch.
The issue will appear also when you remove all content from existing Classic editor that sits in a container block.
This issue breaks edit ability of every existing page that already had empty Classic block in them (thus there is no way for user to avoid that failure if they already placed empty Classic in a container on the page in a past).
This seems to be related to other issue that was fixed with Gutenberg 6.3.0 (#13187).
Screenshots
Error as reported by local WP installation.
Error as reported by wordpress.com.
Desktop (please complete the following information):
Additional context
Issue also appears on wordpress.com.
The text was updated successfully, but these errors were encountered: