#19029 closed defect (bug) (fixed)
Delete Permanently comments one by one in Spams or Trash increases counter
Reported by: | hebbet | Owned by: | duck_ |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.0.5 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Repro:
*Have eg 25 Comments in Spam.
*Delete five using Delete Permanently one by one.
What happens:
After you one comment counter is correct (24), but when you delete the second, third... comment counter will increase (25, 26, 27, 28, 29)
Attachments (1)
Change History (14)
#1
@
13 years ago
- Summary changed from Delete Permanently one comment in Spams increases counter to Delete Permanently comments one by one in Spams or Trash increases counter
#2
@
13 years ago
- Keywords reporter-feedback added
Can you reproduce it in 3.3 beta 2 or trunk version? I can't either in 3.2.1 nor trunk.
#4
@
13 years ago
- Keywords needs-patch added; reporter-feedback removed
Ok, now I see it.
Duplicate: #18963
#5
@
13 years ago
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.
#6
@
13 years ago
- Version changed from 3.2.1 to 3.0.5
Present in 3.0.6 too (not checked earlier). You must have paginated the comments list for it to apply then so that "Displaying 1-x of y" is shown.
#7
follow-up:
↓ 8
@
13 years ago
You do not have to have paginate on. It will do the same thing to "x Items" on the upper right, the number in brackets in "Spam (36) | Trash (0)" count properly.
#8
in reply to:
↑ 7
@
13 years ago
Replying to thee17:
You do not have to have paginate on. It will do the same thing to "x Items" on the upper right, the number in brackets in "Spam (36) | Trash (0)" count properly.
I was talking about reproducing in 3.0.6 and possibly earlier. For 3.2.x and trunk you're correct reproduction doesn't need pagination.
#9
@
13 years ago
- Keywords has-patch added; needs-patch removed
Attached 19029.diff.
The fix for the bug described is the logic change to updating the total value at the bottom. We want to decrement the displayed total unless a trash/spam is being undone.
Also removed the span.total-type-count
update code as "total-type-count" isn't referenced anywhere else in WordPress core. The total updates now take place inline using .displaying-num
. Updated the comment accompanying updateTotalCount() accordingly.
#10
@
13 years ago
- Cc kpayne@… added
19029.diff works for me. One note: Clicking too fast results in the count getting out of sync. screenshot.
also happens in Trash