[wp-trac] [WordPress Trac] #19905: Filtering the edit-comments.php screen results in incorrect Pending count

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 9 14:15:27 UTC 2012


#19905: Filtering the edit-comments.php screen results in incorrect Pending count
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.4
Component:  Comments      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by duck_):

 * keywords:   => has-patch


Comment:

 Replying to [comment:2 ericlewis]:
 > To deal with the issue, my patch moves the .each() out of the
 updatePending function

 I took a slightly different approach. I left the .each() loop in
 updatePending() and instead of passing a new total to the function you
 pass the difference (i.e. 1 or -1). This is good because the difference
 only needs to be calculated once instead of every loop iteration, only the
 current total for each element needs to be grabbed. It also allows a lot
 of code deduplication in dimAfter().

 I also moved the call to dashboardTotals() out of the loop as it only
 needs to be called once. I'm not even sure if it needs to be called in
 updatePending() at all.

 P.S. for future reference you don't need to include the minified version
 of CSS/JS in patches as the committer (well bumpbot now, see #19592) will
 do the minification.

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


More information about the wp-trac mailing list