[wp-trac] [WordPress Trac] #19029: Delete Permanently comments one by one in Spams or Trash increases counter

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 22 21:16:44 UTC 2011


#19029: Delete Permanently comments one by one in Spams or Trash increases counter
--------------------------+------------------------------
 Reporter:  hebbet        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------

Comment (by duck_):

 After a bit of investigation the problem appears to be in delAfter in
 edit-comments.js. I notice that `getUpdate('trash')` returns `-1`. So,
 `total = total - spam - trash` actually increments the total count. This
 incremented total is sent on successive delete requests and the visible
 numbers start going wrong too.

 {{{
 if ( $(settings.target).parent().is('span.' + s) )
   return 1;
 else if ( $('#' + settings.element).is('.' + s) )
   return -1;
 }}}

 the first branch isn't entered as `$(settings.target).parent()` is a span
 with class "delete" and not "trash". The return -1 branch is as the
 comment row does have the trash class.

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


More information about the wp-trac mailing list