Opened 14 years ago
Closed 14 years ago
#17309 closed defect (bug) (fixed)
Pending Count no longer updates on Approve/Unapprove
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Comments | Keywords: | |
Focuses: | Cc: |
Description
Trunk is no longer increasing/decreasing the pending comments count when clicking on "Approve/Unapprove" in the row for a comment from within the Comments Screen.
I suspect this is because dimAfter isn't being called, after clicking Approve/Unapprove, but haven't been able to track down exactly why this is the case yet.
*might* have something to do with the recent jQuery update to trunk, since it hasn't been working at least since that point.
Change History (4)
#3
@
14 years ago
jQuery 1.5 introduced a new featured 'Deferred Object'. IIRC What it does is, it allows multiple callback functions.
jQuery ajax uses deferred object which pushes all callback functions into an array before hand which means dynamically added functions/objects are not taken into account. The ajaxDim
function in wp-lists.dev.js function dynamically creates the 'complete' callback which then calls dimAfter
. Since dynamically added functions/objects are not considered dimAfter
is never called.
s.success = function(r) { ... if ( $.isFunction(s.dimAfter) ) { o = this.complete; this.complete = function(x,st) { ... };
The bug with deferred ajax should be fixed upstream, until then we can revert back to jQuery 1.4 or change the way ajaxComplete
callbacks are managed
Okay, I was able to confirm that the problem originates after the jQuery update.
As of #17724, dimAfter was running after Approve/Unapprove (and the update of the comments was working as well).
After the jQuery update at #17725, dimAfter does not get run after Approve/Unapprove.
This continues to be the case before or after the adjustments made to the quotes in #17777, and after the update fixing Approve/Unapprove AJAX calls in #17780