Gutenberg: Unable to edit Classic Block on regular (web) editor

Created on 20 Aug 2020  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug

This seems related to https://github.com/WordPress/gutenberg/issues/24563, however I didn't see an issue or patch for the regular web editor. After saving a post with a Classic Block, the contents of the Classic Block are not visible and the block encounters a JS error when used.

To reproduce
Steps to reproduce the behavior:

  1. Create a new post with a Classic Block. Save the post.

Screen Shot 2020-08-20 at 11 38 52 AM

  1. Refresh the page. Observe the block content is missing from the Classic Block:

Screen Shot 2020-08-20 at 11 39 26 AM

  1. With the JS console open, click on the block toolbar for the Classic Block (the gray bar that says "Classic"). Observe block encounters a fatal error and the JS console logs Cannot read property 'getContent' of null:

Screen Shot 2020-08-20 at 11 39 39 AM

  1. Go to code view. Observe content is still there:

Screen Shot 2020-08-20 at 11 39 52 AM

  1. Go back to visual view. Observe block preview works correctly after coming from code view:

Screen Shot 2020-08-20 at 11 40 00 AM

Expected behavior
I expected the block content of Classic Block to render correctly when editing a saved post.

Screenshots
See steps to reproduce above.

Editor version (please complete the following information):

  • WordPress version: 5.5.0
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? I reproduced the error on a clean site using only WP 5.5.0 and Gutenberg 8.8.0
  • If the Gutenberg plugin is installed, which version is it? 8.8.0. This bug seems to have been introduced in 8.8.0, as rolling back to 8.7.1 solves the issue.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 84.0.4147.125
[Block] Classic [Priority] High [Status] In Progress [Type] Bug

Most helpful comment

I can reproduce the issue on WP 5.5 with Gutenberg 8.8.0

The problem has not been resolved with WordPress 5.5.1 and Gutenberg 8.9.1

In my opinion, this issue deserves more attention.

To users who are editing content that was created a long time before the block editor was introduced it might appear that the content has been lost. They may not be aware of the workaround to switch to the code editor.

To reproduce:

  1. Edit a post created before the block editor existed. It will appear to contain nothing at all.
  2. Switch to the Code Editor and the content appears.
  3. Switch back to visual and it's OK.

Note: If you don't click on the Classic block, then the Console log does not display the TypeError.

All 5 comments

I can reproduce the issue on WP 5.5 with Gutenberg 8.8.0

I can reproduce the issue on WP 5.5 with Gutenberg 8.8.0

The problem has not been resolved with WordPress 5.5.1 and Gutenberg 8.9.1

In my opinion, this issue deserves more attention.

To users who are editing content that was created a long time before the block editor was introduced it might appear that the content has been lost. They may not be aware of the workaround to switch to the code editor.

To reproduce:

  1. Edit a post created before the block editor existed. It will appear to contain nothing at all.
  2. Switch to the Code Editor and the content appears.
  3. Switch back to visual and it's OK.

Note: If you don't click on the Classic block, then the Console log does not display the TypeError.

The problem has not been resolved with WordPress 5.5.1 and Gutenberg 8.9.1

The problem occurs when Jetpack 8.9 is activated.
It does not occur when Jetpack is deactivated.

In my opinion, this issue deserves more attention.

I have reproduced the problem in a local development environment.
Originally the problem only occurred for a custom post type, but now I can make it appear for posts and pages.

Theme: Twenty Twenty 1.5
Plugin: Gutenberg 8.9.1
WordPress: 5.5.1

Sometimes the problem doesn't occur on first edit, but does when you reload the editor with the Ctrl key pressed.
Using: Chrome and Windows 10. Server: Windows, Apache, PHP 7.4.0

Possible workaround

If deactivating Gutenberg or Jetpack is not an option, then a possible workaround is to activate the Test jQuery Updates plugin ( wp-jquery-update-test ) and set the jQuery version to 3.5; jQuery Migrate can be Enable or Disable.

I'm also encountering this error as well as @bobbingwide confirmed although I am not able to consistently reproduce it and I can't determine why yet.

The content is still present when I view it through the code editor.

I'm able to reproduce this across Gutenberg 8.9.0, 8.9.1 and 8.9.2 (I haven't tested anything earlier(.
FWIW, I've had this occur on separate servers that use ngnix and apache.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorscode picture moorscode  路  3Comments

spocke picture spocke  路  3Comments

jasmussen picture jasmussen  路  3Comments

ellatrix picture ellatrix  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments