[wp-trac] Re: [WordPress Trac] #3699: wp_update_comment_count() causes some plugins to delete usermeta values

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 28 00:21:48 GMT 2007


#3699: wp_update_comment_count() causes some plugins to delete usermeta values
-------------------------+--------------------------------------------------
 Reporter:  markjaquith  |        Owner:  anonymous
     Type:  defect       |       Status:  new      
 Priority:  high         |    Milestone:  2.1.1    
Component:  General      |      Version:  2.1      
 Severity:  major        |   Resolution:           
 Keywords:               |  
-------------------------+--------------------------------------------------
Old description:

> Some users have reported that plugins like Jerome's Keywords and UTW and
> other postmeta adding plugins have been deleting their postmeta values
> for a post when a comment is left on that post.
>
> I installed Jerome's Keywords and experienced the behavior.  The problem
> is this:
>
> 1. Jerome's Keywords always assumes that it was able to successfully
> insert its field into the edit form.
> 2. If the edit_post hook is called in a circumstance where the plugin was
> NOT able to insert its field into the edit form, it assumes that the user
> wanted to delete all keywords.  Thus, the plugin deletes all the
> keywords.
> 3. Commenting in 2.1 calls wp_update_comment_count(), which runs the
> edit_post hook.
>
> While plugin authors are definitely to blame for assuming that "doesn't
> exist" is the same as "exists and is empty," we might want to consider
> using an alternative hook for announcing that the comment count has been
> updated for a post.

New description:

 Some users have reported that plugins like Jerome's Keywords and UTW and
 other postmeta adding plugins have been deleting their postmeta values for
 a post when a comment is left on that post.

 I installed Jerome's Keywords and experienced the behavior.  The problem
 is this:

  1. Jerome's Keywords always assumes that it was able to successfully
 insert its field into the edit form.
  1. If the edit_post hook is called in a circumstance where the plugin was
 NOT able to insert its field into the edit form, it assumes that the user
 wanted to delete all keywords.  Thus, the plugin deletes all the keywords.
  1. Commenting in 2.1 calls wp_update_comment_count(), which runs the
 edit_post hook.

 While plugin authors are definitely to blame for assuming that "doesn't
 exist" is the same as "exists and is empty," we might want to consider
 using an alternative hook for announcing that the comment count has been
 updated for a post.

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


More information about the wp-trac mailing list