Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8584 closed enhancement (fixed)

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

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

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 18 years ago.

Download all attachments as: .zip

Change History (2)

#1 @matt
18 years ago

  • Resolution → fixed
  • Status new → 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.