Make WordPress Core

Opened 5 years ago

Closed 12 months 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:

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 5 years ago.
preserve paged
16162.2.patch (1.2 KB) - added by SergeyBiryukov 5 years ago.
16162.diff (514 bytes) - added by ericlewis 17 months ago.

Download all attachments as: .zip

Change History (25)

comment:1 @ocean905 years ago

  • Component changed from General to Administration

Related: #15416

comment:2 @ocean905 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 5 years ago by ocean90 (previous) (diff)

comment:3 @hakre5 years ago

I was able to reproduce against latest trunk.

comment:4 @hakre5 years ago

It does not reflect the sort column as well.

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

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

@hakre5 years ago

preserve paged

comment:5 @hakre5 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.

comment:6 @scribu5 years ago

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

comment:7 @SergeyBiryukov5 years ago

  • Keywords has-patch added; needs-patch removed

hakre's patch works for me.

comment:8 @voyagerfan57615 years ago

  • Cc WordPress@… added

comment:9 @nacin5 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.

@SergeyBiryukov5 years ago

comment:10 @SergeyBiryukov5 years ago

Tried to take a stab at it.

comment:11 @SergeyBiryukov5 years ago

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

comment:12 @garyc405 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?

comment:13 @scribu5 years ago

  • Owner scribu deleted

comment:14 @dd325 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

comment:15 @ocean905 years ago

Replying to dd32:

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


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

comment:16 @ryno2674 years ago

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

comment:17 @scribu4 years ago

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

Yeah, need to handle this either way.

comment:18 @nacin20 months ago

  • Component changed from Administration to Media
  • Focuses administration added

@ericlewis17 months ago

comment:19 @ericlewis17 months 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 17 months ago by ericlewis (previous) (diff)

comment:20 @wonderboymusic13 months ago

  • Milestone changed from Future Release to 4.1

comment:21 @wonderboymusic13 months ago

  • Component changed from Media to Administration

comment:22 @wonderboymusic12 months 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.