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

Error 400 when trying to save a post with an empty Classic block as only content #6979

Closed
afercia opened this issue May 28, 2018 · 1 comment

Comments

@afercia
Copy link
Contributor

afercia commented May 28, 2018

Gutenberg allows to save posts with empty blocks, for example:

  • create a new post
  • leave the title empty
  • add a paragraph and leave it empty
  • save as draft
  • saving is successful
  • add an Image block but don't add an image
  • add a List block and leave it empty
  • save as draft
  • saving is successful

Instead:

  • create a new post
  • leave the title empty
  • add a Classic block and leave it empty
  • click on Save draft
  • you will get an "Updating failed" warning (see screenshot below)

Actually, for a brief moment you will see the Save draft button changed in "Saved" together with the "Updating failed" warning. A bit confusing:

screen shot 2018-05-28 at 14 40 11

After that, "Saved" turns back into "Save Draft":

screen shot 2018-05-28 at 14 39 49

The API response is:
{"code":"empty_content","message":"Content, title, and excerpt are empty.","data":{"status":400}}

Instead, saving a post with only an empty paragraph returns the whole post data, with an empty paragraphs as content: "<p><\/p>\n"

@danielbachhuber
Copy link
Member

Duplicate of #6556

@danielbachhuber danielbachhuber marked this as a duplicate of #6556 Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants