-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
400 bad request trying to autosave empty content #6556
Comments
Thanks for the report, @bobbingwide. I can reproduce this issue: More specifically, I think this issue happens because an empty Classic block is sent to the server as Building on #1203, I'd suggest we add some special case behavior to |
I can imagine scenarios where the content of the title, post and excerpt is automatically created by plugins from meta data. I have one CPT in my Golf Society's website where the posts are generated with content of e.g. https://www.anchorgolf.com/result/28-apr-hurtmore-winner-herb-miller/ The posts are created programatically. Perhaps empty content should be allowed. |
I'm not quite sure I agree with this result. I'm able to "save" an empty post: However, if I saved it with an empty title and content, it's not accessible in Edit Posts: In the database, it's saved as an
I understand how this is a change in behavior that would need to be documented. Can you explain to me how it's a break in backwards compatibility? |
If this regression is then considered to be a bug then it needs to be worked on. In this case the documentation might cover how to publish an empty post using the block editor. |
Thanks for clarifying, @bobbingwide. We'll get this sorted out one way or another. |
To create an empty post, with a nice slug.
Or, for a numeric slug, omit the title. |
Coming back to this, I think there's one specific scenario to solve for: the user should never experience an "Updating failed" state like this: However unlikely, it should be possible for a user to:
But, this isn't currently possible because of: I'm not sure which technical solution we should apply yet. |
Additional technical context / possible solution at #7727 |
While @pento and I were chatting on Tuesday, we discovered some additional odd behavior of the Classic Editor:
|
For the purposes of replicating Classic Editor behavior, I'd be fine the solution proposed in #7727 — prevent any saving if the title is empty and the editor has an empty Classic Block. |
@aduth @youknowriad Do either of you have a preferred implementation for this? |
|
Issue Overview
When adding a new post I got an unexpected "Updating failed" message.
The console log showed 400 bad request.
The response being
Steps to Reproduce (for bugs)
Expected Behavior
Either no attempt to save the post or allow the empty content to be saved.
Current Behavior
Autosave kicks in. Since none of the following have been entered... Title, Content and Excerpt
we get the 400 Bad request. which leads to the display of the unexpected "Updating failed" message.
Possible Solution
Screenshots / Video
Related Issues and/or PRs
#1201
Todos
The text was updated successfully, but these errors were encountered: