WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8584 closed enhancement (fixed)

Update pagination links on edit-comments when approving/deleting/etc

Reported by: mdawaffe Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description

If you have 23 comments pending approval, and you approve 3 of them, the pagination links should reflect the fact that there is now only 1 page worth of comments.

Attached keeps track of how many total comments there are (for that comment view: all, pending, approved...) and keeps the displayed total and displayed page links up to date.

This also keeps the total and the pagination links up to date in the event of new comments coming in.

Method:

  1. When a comment is removed, the total decrements: no DB access needed.
  2. Comment totals are calculated explicitly from the DB when:
    1. The browser thinks the total number of pages is about to change.
    2. Randomly at a frequency of 1/$per_page.

The first time to reset the total and page links to the real value, the second time to keep everyone honest.

  1. All AJAX data is sent back to the browser with a timestamp, so the JS can decide if the new total is more or less up to date than what it thinks.

Attachments (1)

8584.diff (9.1 KB) - added by mdawaffe 5 years ago.

Download all attachments as: .zip

Change History (2)

mdawaffe5 years ago

comment:1 matt5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10204]) Update pagination links on edit-comments when approving/deleting/etc. Hat tip: mdawaffe. Fixes #8584.

Note: See TracTickets for help on using tickets.