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

Update Failed when trying to save draft #3252

Closed
2 tasks
mgarf opened this issue Oct 31, 2017 · 13 comments
Closed
2 tasks

Update Failed when trying to save draft #3252

mgarf opened this issue Oct 31, 2017 · 13 comments
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended

Comments

@mgarf
Copy link

mgarf commented Oct 31, 2017

Issue Overview

When a user in wp admin tries to save a draft, it gets update failed

Steps to Reproduce (for bugs)

  1. Go to New Post
  2. Enter Content
  3. Hit Save

Expected Behavior

Update should occur

Current Behavior

No save occurs.

Console shows the following:
image

Possible Solution

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@aduth
Copy link
Member

aduth commented Oct 31, 2017

My assumption is that the host might not have support for HTTP verbs except basic GET and POST.

The REST API has built-in support for manually specifying intended method on a POST request:

https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_method-or-x-http-method-override-header

I'm not clear on how this is meant to be used from a client, whether it is built-in for the Backbone client or api-request utilities, or must be manual opt-in.

@mgarf
Copy link
Author

mgarf commented Nov 1, 2017

Hmm any thoughts on how to get around this issue

@aduth aduth added the Core REST API Task Task for Core REST API efforts label Nov 1, 2017
@aduth
Copy link
Member

aduth commented Nov 1, 2017

@mgarf On your end, this is dependent on the hosting environment supporting HTTP verbs aside from just GET and POST. I am unsure how much control you have over this, depending on your host, but in Apache and nginx I believe these restrictions must be explicitly put in place, so a resolution could be to remove them if the option is available.

From the WordPress end, arguably it seems that the underlying Backbone client and api-request should use the POST verb with _method argument as more compatible default.

I raised this today in the core-restapi Slack channel: https://wordpress.slack.com/archives/C02RQC26G/p1509540912000307

@mgarf
Copy link
Author

mgarf commented Nov 3, 2017

@aduth thank you for raising the concern with core-restapi. I'll try to figure out on my side on an easy solution to enable those wider range of verbs on azure.

@jeffpaul
Copy link
Member

jeffpaul commented Mar 7, 2018

@mgarf as discussed in last week's bug scrub, this could be a duplicate of #2565. Are you using CloudFlare? If not, could you provide additional details on your testing environment?

@mgarf
Copy link
Author

mgarf commented Mar 7, 2018

My apologies I never updated this thread. Once I expanded the verbs saving worked properly.

The environment was a azure web app with WordPress running on IIS. No cloudflare

@jeffpaul
Copy link
Member

jeffpaul commented Mar 7, 2018

@mgarf apologies but I'm not clear, is this still an issue or can this be closed?

@jeffpaul jeffpaul added the [Status] Needs More Info Follow-up required in order to be actionable. label Mar 7, 2018
@svnsbck
Copy link

svnsbck commented Mar 11, 2018

I'm having the same issue here. Failing every time and leaving a blank AUTO-SAVE.

@chameleon-tbn
Copy link

chameleon-tbn commented Mar 17, 2018

@svnsbck Do you use any Firewall Plugin?

For example at All In One WP Security & Firewall it is needed to deactivate the '6G Firewall Protection'. With the 'legacy 5G Firewall Protection' Gutenberg works fine.

You can find the settings at Dashboard - WP Security - Firewall - 6G Blacklist Firewall Rules

image

See also #2565

@mgarf
Copy link
Author

mgarf commented Mar 17, 2018

@jeffpaul yep thjis can be closed

@jeffpaul
Copy link
Member

@svnsbck is your issue occurring when trying to save a draft?

@svnsbck
Copy link

svnsbck commented Mar 19, 2018

@jeffpaul Yes, just tested again. It happens both when manually saving and the autosave. Looking at the "all posts" list shows merely a "AUTO DRAFT" which is empty and doesn't have a title. Also noticed that the "Categories and Tags" are not read and are empty.

@jeffpaul jeffpaul added [Type] Bug An existing feature does not function as intended and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Mar 20, 2018
@danielbachhuber
Copy link
Member

Closing, per #3252 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants