#16357 closed defect (bug) (fixed)
Bugs with pagination input
Reported by: | garyc40 | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch needs-testing |
Focuses: | 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 inwp-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)
#1
@
13 years ago
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.
#2
@
13 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?
#3
@
13 years ago
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.
#4
@
13 years ago
This looks great to me. Fixes the issues. Can I get a few other people to do a sanity check?
#5
@
13 years ago
For people reviewing: the patch under consideration is: http://core.trac.wordpress.org/attachment/ticket/16357/garyc40.16356.diff
#6
@
13 years ago
TortoiseSVN didn't like the patch for some reason. Works great after manual editing. Tested all the cases outlined in the description.
#8
@
13 years ago
- 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; }
#9
@
13 years ago
There are two more instances in Site Admin > Users and Categories / Tags . Above patch fixes this.
fix redirection inconsistencies in
edit-tags.php, users.php, network/users.php