[wp-trac] [WordPress Trac] #16567: Can't create categories with different names but similar slugs on Edit Post screen

WordPress Trac noreply at wordpress.org
Sun Oct 21 17:31:21 UTC 2012


#16567: Can't create categories with different names but similar slugs on Edit Post
screen
----------------------------+--------------------
 Reporter:  jeffreymcmanus  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.5
Component:  Administration  |     Version:  3.0.5
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------

Comment (by ericlewis):

 Replying to [comment:13 technosailor]:
 > Replying to [comment:12 SergeyBiryukov]:
 > > Replying to [comment:11 technosailor]:
 > > > I don't agree that wp_insert_term should be where the checks are
 happening. It adds a potentially unneeded query. We should not be doing
 wp_insert_term if term_exists.
 > >
 > > Quite the contrary, [attachment:16567.2.diff] prevents `term_exists()`
 from being called twice if the term does not exist, since
 `wp_insert_term()` calls it anyway.
 >
 > Then `wp_insert_term()` shouldn't be calling it. We shouldn't be doing
 an insert if there is a collision as that adds a DB call.

 Changing the functionality of wp_insert_term seems out of the scope of
 this ticket.

 16567.2 works for me.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16567#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list