[wp-trac] [WordPress Trac] #39984: wp_insert_term can return wrong ID when multiple existing terms are found with the same name but differnet parent

WordPress Trac noreply at wordpress.org
Tue Feb 28 13:47:06 UTC 2017


#39984: wp_insert_term can return wrong ID when multiple existing terms are found
with the same name but differnet parent
-------------------------------------------------+-------------------------
 Reporter:  mikejolley                           |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  General                              |  Review
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch dev-feedback needs-        |  Resolution:
  testing                                        |     Focuses:
-------------------------------------------------+-------------------------
Changes (by mikejolley):

 * keywords:   => has-patch dev-feedback needs-testing


Comment:

 Added a potential patch, but it needs some more eyes and testing. It does
 2 things;

 1. Ensures only terms from the specified parent are found to check names.
 2. It forces the name check if no slug was provided by the user. This is
 because the slug (if multiple terms with same name exists) will already
 have a suffix.

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


More information about the wp-trac mailing list