[wp-trac] [WordPress Trac] #24461: _get_term_children can loop forever (well until it times out) if there is a loop in the hierarchy

WordPress Trac noreply at wordpress.org
Wed Dec 31 20:38:02 UTC 2014


#24461: _get_term_children can loop forever (well until it times out) if there is a
loop in the hierarchy
--------------------------+------------------
 Reporter:  westi         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.2
Component:  Taxonomy      |     Version:  3.6
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------
Changes (by boonebgorges):

 * keywords:  needs-patch good-first-bug => has-patch
 * milestone:  Future Release => 4.2


Comment:

 sgrant - Thanks for the test. We should just be able to keep track on the
 fly of which items are identified as part of the hierarchy branch, then
 pass those `$ancestors` by reference when we recurse, and make sure we
 don't recurse if we've already identified the term in question as part of
 the branch. See [attachment:24461.patch].

 The patch subsumes [27837], since the case where a term has itself as a
 parent is just one specific instance of the general problem of hierarchy
 loops. 24461.patch is a more general solution.

 Could I get a second set of eyes on this?

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


More information about the wp-trac mailing list