gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Auto-save fail with remove_post_type_support

Open arnolem opened this issue 8 years ago • 4 comments

Describe the bug I have a plugin who use this :

add_action('init', function () {
    remove_post_type_support('post', 'revisions');
});

When the auto-save query is sent to /wp-json/wp/v2/posts/12/autosaves, WordPress send a 404 HTTP error

{"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}

To Reproduce Steps to reproduce the behavior:

  1. Add the following code on function.php
add_action('init', function () {
    remove_post_type_support('post', 'revisions');
});
  1. Create a new article with Gutenberg
  2. Write a title and a little paragraph
  3. Wait autosave to view error

Screenshots image

Desktop (please complete the following information):

  • OS: Win10
  • Browser Firefox 61.0.1 (64 bits)

Additional context

  • WordPress Version 4.9.8
  • Gutenberg Version 3.4.0

arnolem avatar Aug 04 '18 20:08 arnolem

I had a similar problem. I fixed it with the Cloudflare Firewall "fix"

abwdvm avatar Aug 04 '18 21:08 abwdvm

I made this ;) http://www.ksstradio.com/2017/12/the-gutenberg-cloudflare-free-fix/

abwdvm avatar Aug 04 '18 21:08 abwdvm

Sorry, I do not use cloudFlare. And I cannot view your article image

arnolem avatar Aug 04 '18 21:08 arnolem

This also affects custom post types where revision support is not enabled. It looks like the Autosaves controller incorrectly requires revisions for autosave support.

adamsilverstein avatar Aug 07 '18 18:08 adamsilverstein