[wp-trac] [WordPress Trac] #41370: REST API: Attempting to create an existing term yields HTTP 500

WordPress Trac noreply at wordpress.org
Sun Sep 17 03:11:06 UTC 2017


#41370: REST API: Attempting to create an existing term yields HTTP 500
-------------------------------------------------+-------------------------
 Reporter:  jnylen0                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  REST API                             |  Release
 Severity:  normal                               |     Version:  4.7
 Keywords:  needs-unit-tests good-first-bug      |  Resolution:
  needs-testing                                  |     Focuses:  rest-api
-------------------------------------------------+-------------------------

Comment (by guzzilar):

 Agree on this. I was testing request to '''/wp-json/wp/v2/categories'''
 and found that it returns status 500 error when attempting to create an
 existing term.

 Tested on
 - WP: 4.9-alpha-40870-src
 - REST URL: /wp-json/wp/v2/categories
 - Request Body:
   - name: "test"

 Try post this twice and you will get
 - Response Status: 500
 - Response Body:
 {{{
 {
     "code": "term_exists",
     "message": "A term with the name provided already exists with this
 parent.",
     "data": 3
 }
 }}}

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


More information about the wp-trac mailing list