Make WordPress Core

Opened 9 years ago

Closed 5 years ago

#16162 closed defect (bug) (fixed)

Pagination and sorting reset after bulk media deletion

Reported by: hakre Owned by: wonderboymusic
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch
Focuses: administration Cc:
PR Number:

Description (last modified by scribu)

When doing Bulk Deletes on paginated Media Library, after performing the delete, I'm back on page 1 regardless on which page I've been before.

Attachments (3)

16162-paged.patch (469 bytes) - added by hakre 9 years ago.
preserve paged
16162.2.patch (1.2 KB) - added by SergeyBiryukov 9 years ago.
16162.diff (514 bytes) - added by ericlewis 6 years ago.

Download all attachments as: .zip

Change History (25)

#1 @ocean90
9 years ago

  • Component changed from General to Administration

Related: #15416

#2 @ocean90
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.1
  • Owner set to scribu
  • Status changed from new to reviewing

Same for categories and tags page. If we have it for posts and comments (#15416), we should add it with the other pages too.

Last edited 9 years ago by ocean90 (previous) (diff)

#3 @hakre
9 years ago

I was able to reproduce against latest trunk.

#4 @hakre
9 years ago

It does not reflect the sort column as well.

paged is part of the request, orderby and order are not.

Last edited 9 years ago by hakre (previous) (diff)

9 years ago

preserve paged

#5 @hakre
9 years ago

The patch preserves paged for bulk media deletes. sorting is not preserved as it does not gets passed in the request.

The idea I had so far is to add hidden form fields or to change the forms action attribute when things are changed by javascript.

The only hotfix I know of so far is to disable javascript which makes one of the biggest improvements of 3.1 looking pretty reduced.

#6 @scribu
9 years ago

  • Description modified (diff)
  • Summary changed from Bulk Actions and Pagination: Page Lost to Pagination and sorting reset after bulk media deletion

#7 @SergeyBiryukov
9 years ago

  • Keywords has-patch added; needs-patch removed

hakre's patch works for me.

#8 @voyagerfan5761
9 years ago

  • Cc WordPress@… added

#9 @nacin
9 years ago

  • Keywords needs-patch added; has-patch removed

Noting that ocean90 was also able to reproduce this against edit-tags.php. A few of us were looking at this today (MarkJaquith in particular) and pagination was inconsistent across a number of screens.

#10 @SergeyBiryukov
9 years ago

Tried to take a stab at it.

#11 @SergeyBiryukov
9 years ago

Looks like the Plugins screen is affected too. Are there any else?

#12 @garyc40
9 years ago

My patch over here also fixes pagination and sort reset for edit-tags, edit-comments, edit .

Perhaps we should merge this ticket and #16166?

#13 @scribu
9 years ago

  • Owner scribu deleted

#14 @dd32
9 years ago

  • Milestone 3.1 deleted
  • Resolution set to duplicate
  • Status changed from reviewing to closed

Combining this, as the patch over on 16162 should fix this once it's applied to the rest of the list tables.

Duplicate of #16162

#15 @ocean90
9 years ago

Version 0, edited 9 years ago by ocean90 (next)

#16 @ryno267
8 years ago

This is still an issue and imo shouldn't be merged with the ajax ticket. Any resolution to this

#17 @scribu
8 years ago

  • Milestone set to Future Release
  • Resolution duplicate deleted
  • Status changed from closed to reopened

Yeah, need to handle this either way.

#18 @nacin
6 years ago

  • Component changed from Administration to Media
  • Focuses administration added

6 years ago

#19 @ericlewis
6 years ago

  • Keywords has-patch added; needs-patch removed

This has been fixed for the Edit Media list, but is still a problem on the tags and categories page.

This is because the <form>'s method attribute is set to post, rather than get, which ends up throwing off wp_get_referer(), losing the paged parameter in the link. attachment:16162.diff fixes the form method.

Last edited 6 years ago by ericlewis (previous) (diff)

#20 @wonderboymusic
5 years ago

  • Milestone changed from Future Release to 4.1

#21 @wonderboymusic
5 years ago

  • Component changed from Media to Administration

#22 @wonderboymusic
5 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from reopened to closed

In 29782:

In the form handler logic for edit-tags.php, don't redirect until $_REQUEST['paged'] has been checked. All switch cases (except edit) now use break instead of exit.

Fixes #16162.

Note: See TracTickets for help on using tickets.