Skip to content
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

Unable to edit Classic Block on regular (web) editor #24696

Closed
claudiulodro opened this issue Aug 20, 2020 · 5 comments · Fixed by #25162
Closed

Unable to edit Classic Block on regular (web) editor #24696

claudiulodro opened this issue Aug 20, 2020 · 5 comments · Fixed by #25162
Assignees
Labels
[Block] Classic Affects the Classic Editor Block [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@claudiulodro
Copy link
Contributor

Describe the bug

This seems related to #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
@Soean
Copy link
Member

Soean commented Aug 25, 2020

I can reproduce the issue on WP 5.5 with Gutenberg 8.8.0

@Soean Soean added the [Block] Classic Affects the Classic Editor Block label Aug 25, 2020
@bobbingwide
Copy link
Contributor

bobbingwide commented Sep 7, 2020

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.

@bobbingwide
Copy link
Contributor

bobbingwide commented Sep 7, 2020

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.

@bobbingwide
Copy link
Contributor

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.

@skorasaurus
Copy link
Member

skorasaurus commented Sep 8, 2020

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.

@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended [Priority] High Used to indicate top priority items that need quick attention labels Sep 8, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 8, 2020
ockham added a commit that referenced this issue Sep 10, 2020
…25169)

Adds a regression test in the client block E2E spec to avoid the regression of the Classic block, per this issue:  #24696, as suggested in #25162 (comment).

Co-authored-by: Bernie Reiter <ockham@raz.or.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Classic Affects the Classic Editor Block [Priority] High Used to indicate top priority items that need quick attention [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants