[wp-trac] Re: [WordPress Trac] #4500: wp_set_object_terms is not increasing taxonomy count correctly.

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 27 22:29:27 GMT 2007


#4500: wp_set_object_terms is not increasing taxonomy count correctly.
----------------------------+-----------------------------------------------
 Reporter:  cavemonkey50    |        Owner:  anonymous  
     Type:  defect          |       Status:  new        
 Priority:  normal          |    Milestone:  2.3 (trunk)
Component:  Administration  |      Version:  2.3        
 Severity:  major           |   Resolution:             
 Keywords:  has-patch       |  
----------------------------+-----------------------------------------------
Changes (by cavemonkey50):

 * cc: ron at cavemonkey50.com (added)
  * keywords:  => has-patch
  * severity:  normal => major
  * milestone:  => 2.3 (trunk)

Comment:

 I've tracked down the problem. wp_update_term_count is checking if
 $taxonomy->update_count_callback is set to a custom update function. The
 problem is $taxonomy->update_count_callback is always set to a default
 value of null. My attached patch also checks to see if the
 $taxonomy->update_count_callback is not set to null.

 In addition, even once you get past that step, the actual update function
 needed to be in a foreach loop. My attached patch corrects this issue
 also.

 Finally, I would just like to clarify that this not only affects custom
 taxonomies, but the taxonomy link_category also. link_category is not
 using a custom update function, therefore falls into this defect.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4500#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list