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

odious’s picture

StatusFileSize
new762 bytes

rerolled patch with -up

wulff’s picture

I am experiencing the same undesired behavior and can confirm that the patch fixes the problem.

ac’s picture

subscribing

ac’s picture

Can someone please review and commit this.

ac’s picture

This 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.

drumm’s picture

Version: 5.x-dev » 6.x-dev
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new978 bytes

Committed to 5.x and attached is a version which applies cleanly to 6.x.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.