[wp-trac] [WordPress Trac] #41370: REST API: Attempting to create an existing term yields HTTP 500
WordPress Trac
noreply at wordpress.org
Tue Sep 26 04:55:41 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: good-first-bug has-unit-tests has- | Resolution:
patch | Focuses: rest-api
-------------------------------------------------+-------------------------
Changes (by shooper):
* keywords: needs-unit-tests good-first-bug needs-testing => good-first-
bug has-unit-tests has-patch
Comment:
Looked at @alibasheer's patch and wrote an updated one that returns an
HTTP 409 if the term already exists.
Unit test also included. The only thing I wasn't quite sure of is that I
put the unit tests in the rest-categories-controller.php. I did this as
it already had the test to create a category, so this was an easy
addition. Not sure if it should have been somewhere more generic though.
Open to suggestions.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41370#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list