[wp-trac] [WordPress Trac] #27123: get_categories returning duplicate child categories in 3.9

WordPress Trac noreply at wordpress.org
Fri Mar 28 18:58:53 UTC 2014


#27123: get_categories returning duplicate child categories in 3.9
--------------------------+-----------------------------
 Reporter:  BStofko       |       Owner:  wonderboymusic
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  3.9
Component:  Taxonomy      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by kovshenin):

 * keywords:  has-patch commit => has-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 I think r27458 has the potential of an infinite recursion resulting in a
 fatal error.

 I haven't found a way to create a term and then set its parent to itself
 from the UI, but clearly it was possible, at least with `wp_update_term()`
 before r15806. We have a check in `_get_term_children()` to avoid that
 loop, but the move to `get_term_children()` skips that check.

 Probably quite an edge case, but I have come across at least a dozen blogs
 with the borked term parents in the database, as well as a few with the
 correct data but a borked `category_children` option.

 Patch with unit tests in [attachment:27123.diff].

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


More information about the wp-trac mailing list