[wp-trac] [WordPress Trac] #14485: Didn't show up children category when created parent and children categories at the same time.

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 25 18:25:51 UTC 2010


#14485: Didn't show up children category when created parent and children
categories at the same time.
--------------------------+-------------------------------------------------
 Reporter:  thealien      |       Owner:                
     Type:  defect (bug)  |      Status:  new           
 Priority:  high          |   Milestone:  3.0.2         
Component:  Cache         |     Version:  3.0           
 Severity:  normal        |    Keywords:  category,cache
--------------------------+-------------------------------------------------

Comment(by mfields):

 I was able to reproduce this as reported on a single site installation. I
 found that this issue does not really spring from the object cache rather
 from an option: "{$taxonomy}_children" which does not seem to get updated
 when new child categories are added.

 I believe that this is caused by a bug in the _get_term_hierarchy()
 function line 2297 of /wp-includes/taxonomy.php. This function will always
 return the value of the "{$taxonomy}_children" option if that value is an
 array. Basically if there are children for any category, this function
 will not update the option. A quich fix would be to remove this
 conditional from the function:

 {{{
 if ( is_array($children) )
         return $children;
 }}}

 Removing these lines kills the benefit of storing the result in the
 options table though. Perhaps moving it to object cache might be a better
 solution? I'm not really comfortable creating a patch for this, but
 thought I would help by sharing my experience.

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


More information about the wp-trac mailing list