Noticed this on a site with lots of users each with lots of roles...
Expected: pager on admin/user/user displays the correct number of pages for the number of users in users table.
Observed: pager can render with more pages than are required. eg, pager shows links to 5 pages, but clicking admin/user/user?page=4 shows no users.
in function user_admin_account():
$sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where'];
$result = pager_query($sql, 50, 0, NULL, $filter['args']);
As user_roles has one to many uid to rid, passing NULL to pager_query causes the 'SELECT DISTINCT u.uid' to be replaced with SELECT COUNT(*) causing $pager_total_items to be off in pager_query.
The attached patch is for DRUPAL-5 (user.module revision 1.745.2.15), but the code is the same in HEAD.
Comments
Comment #1
odious commentedrerolled patch with -up
Comment #2
wulff commentedI am experiencing the same undesired behavior and can confirm that the patch fixes the problem.
Comment #3
acsubscribing
Comment #4
acCan someone please review and commit this.
Comment #5
acThis issue seems to be fixed in 5.3 although this patch was never commited. Can someone confirm this and mark as fixed if that is the case please.
Comment #6
drummCommitted to 5.x and attached is a version which applies cleanly to 6.x.
Comment #7
gábor hojtsyThanks, committed.
Comment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.