[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves

WordPress Trac noreply at wordpress.org
Thu Jul 19 13:59:38 UTC 2018


#43316: REST API: Support autosaves
-------------------------------------------------+-------------------------
 Reporter:  kraftbj                              |       Owner:  rmccue
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.0
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by aduth):

 As of
 [https://core.trac.wordpress.org/attachment/ticket/43316/43316.14.diff the
 most recent patch version], there are errors which are returned from the
 controller which will issue a 5xx status code, where in fact there are
 better alternatives available.

 - The `rest_autosave_no_changes` error assigns no status code. This has
 been remedied in Gutenberg's implementation to assign a `400` status code.
 See [https://github.com/WordPress/gutenberg/pull/7347 GB#7347].
 - When `wp_update_post` returns an error (e.g. "Content, title, and
 excerpt are empty"), it is returned verbatim. At least in this specific
 example, a 400 status code would be more appropriate. Gutenberg does not
 handle this well either as of yet.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43316#comment:92>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list