Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#16187 closed defect (bug) (fixed)

Page Number Jumps after Bulk Action

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

Description

I was on page X where X != 1, then I step down to page 1. Then I bulk delete all entries (100). After deletion I am on page 8 of 4 (?!).

Probably related to the other bulk update table navigation problems.

Attachments (4)

16187-after-bulk.png​ (45.8 KB ) - added by hakre 16 years ago.
16187.diff​ (1.2 KB ) - added by greuben 16 years ago.
16187.002.diff​ (1.3 KB ) - added by markjaquith 16 years ago.
16187-3.diff​ (3.5 KB ) - added by greuben 16 years ago.

Download all attachments as: .zip

Change History (13)

#1 @hakre
16 years ago

This is a bit tricky to reproduce. I have this in Chrome with JS on.

First of all, I navigate to:

http://example.com/wp-admin/upload.php?orderby=title&order=asc&paged=8&deleted=100

You need to have at least more than one page to trigger this. In my case this will display page 8 of 7.

Then I use the arrow buttons next to the paged textbox on top of the table to move to page 1.

Even the URL in Chromes address field now has paged=1 instead of 8, after performing a bulk action, I come back to paged=8.

(tested on wordpress.com)

Version 1, edited 16 years ago by hakre (previous) (next) (diff)

#2 @nacin
16 years ago

  • Milestone Awaiting Review → 3.1

#3 @greuben
16 years ago

checking paged against total pages is a simple fix.

@greuben
16 years ago

#4 @markjaquith
16 years ago

Attachments was missing the redirect that posts and comments have if paged is greater than the maximum number of pages. Did that... so that takes care of going directly to the URL. Then took the second part of greuben's patch, which should enforce it via AJAX.

Please test!

#5 @garyc40
16 years ago

  • Keywords has-patch needs-testing added

#6 @nacin
16 years ago

(In [17271]) Force get_pagenum to validate max pages. Add sanity redirect code to upload.php. see #16187. props MarkJaquith, greuben.

#7 @nacin
16 years ago

We need to go through the other list tables to see where else that redirect code needs to end up.

@greuben
16 years ago

#8 @greuben
16 years ago

Attached a patch where this redirect is needed except for users list table and mu users list able.

For both users list table we rely on paged arg for offset which returns zero results in this case total_pages cannot be calculated.

#9 @markjaquith
16 years ago

  • Resolution → fixed
  • Status new → closed

(In [17274]) Add "paged param is greater than total pages" redirects to a few more screens. props greuben. fixes #16187

Note: See TracTickets for help on using tickets.