#16357 closed defect (bug) (fixed)
Bugs with pagination input
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1 |
| Component: | General | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: |
Description
(moved from #16356)
There are a few bugs with pagination that I found
- users.php don't redirect when $pagenum > $total_pages
- Go to edit-tags.php, navigate to the 3rd page, for example. Then enter 2 in the pagination input box and press enter. You'll be in page number 3.
- Go to network/users.php , enter a page number in the pagination input box and press enter. It simply redirects to page 1.
- WP_Users_List_Table and WP_MS_Users_List_Table doesn't set the proper pagination args when $pagenum > $total_pages . This is because total user count is not executed when no results are returned from the query. See the change I made in wp-includes/user.php.
Should all the redirection when $pagenum > $total_pages be centralized in WP_List_Table? We can put that logic inside WP_List_Table->set_pagination_args().
Attachments (4)
Change History (16)
Related to #16208.
Since #16208 is marked as 3.2-early, and the centralization of redirection is kind of too much change for 3.1 especially when we're already at RC3, I think we should only focus on the bugs outlined in the description (addressed in garyc40.16356.diff) .
I attached garyc40.16356.2.diff here anyways, just in case someone wants to test it.
comment:2
markjaquith — 2 years ago
- Milestone changed from Awaiting Review to 3.1
- Owner set to markjaquith
- Status changed from new to accepted
Is Sergey's patch incorporated into your patch? i.e. are you just including it for historical purposes?
For historical purposes. My patch is posted after his, and has similar changes in wp-admin/users.php
The approach for counting users when $paged > $total_pages is different, and I tried to fix pagination issues on other pages as well.
Sorry for the confusion.
comment:4
markjaquith — 2 years ago
This looks great to me. Fixes the issues. Can I get a few other people to do a sanity check?
comment:5
markjaquith — 2 years ago
For people reviewing: the patch under consideration is: http://core.trac.wordpress.org/attachment/ticket/16357/garyc40.16356.diff
comment:6
SergeyBiryukov — 2 years ago
TortoiseSVN didn't like the patch for some reason. Works great after manual editing. Tested all the cases outlined in the description.
- Resolution set to fixed
- Status changed from accepted to closed
- Resolution fixed deleted
- Status changed from closed to reopened
This breaks Network > Users when no search results - we end up with a redirect loop as $pagenum} is 1 and {{{$total_pages}} is 0
Something like this fixes it:
if ( $pagenum > $total_pages && 0 != $total_pages ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit;
}
There are two more instances in Site Admin > Users and Categories / Tags . Above patch fixes this.
comment:10
westi — 2 years ago
- Resolution set to fixed
- Status changed from reopened to closed
comment:11
westi — 2 years ago
All these redirects seem to work in a lame way - hopefully we can fix them with some centralisation of the code in 3.2
comment:12
markjaquith — 2 years ago
westi — agreed! #16208

fix redirection inconsistencies in edit-tags.php, users.php, network/users.php