Hi there,
I have a Drupal 5 website with +/- 300 user accounts. I noticed recently that the last 2 pages of the "Users List" (Administer > User management > Users) are empty and display a "No users available" message. All the users are being displayed in the first 5 pages, so it looks like the pager is adding 2 extra empty pages (page 6 and 7). When a filter is applied to the list, the pager is listing the page correctly and no additional empty pages are added at the end of the list. One of the filters used for the test is outputting close to 300 users (5 pages).
Just wondering if there is a way to fix this issue.
Any help would be really appreciated. Thanks.
--------------------------------------------------
Drupal 5.3
Core Modules Enabled:
Color, Comment, Help, Menu, Path, Profile, Search, Statistics, Taxonomy, Tracker, Upload
Contrib Modules Installed:
CCK 5.x-1.6-1, Views 5.x-1.6, Content Templates 5.x-1.8, Date API 5.x-1.8, Backup and Migrate 5.x-1.1, Diff 5.x-1.1, Google Analytics 5.x-1.3, Login Destination 5.x-1.0, Pathauto 5.x-2.0, Revision Moderation 5.x-1.0, Token 5.x-1.9, Update Status 5.x-2.0
Contrib Modules Installed (User-related):
Account Types 5.x-1.4, Organic Groups 5.x-4.1, OG Subgroups 5.x-3.0-dev, Account Expiry 5.x-1.x-dev, Site User List 5.x-1.x-dev
Server Specs:
Apache 2.0.54, PHP 5.2.6, MySQL 4.1.25
--------------------------------------------------
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | user.patch | 843 bytes | claudiu.cristea |
| #2 | user.module_fix_userlist_filtering.patch | 559 bytes | claudiu.cristea |
Comments
Comment #1
claudiu.cristeaI'm facing the same problem when I use 2 filters by role.
Comment #2
claudiu.cristeaThe bug is caused by a SQL architecture. When someone wants to filter by two roles (find users that belongs to both roles) Drupal generates this SQL query:
while
DISTINCTis used this query will NEVER return any result... We replace the role filters so the above query will look like this:This fixes the issue.
Attached you can find a patch for this.
Comment #3
drummThe UI says the roles will be ANDed, this would need to be fixed there too. We generally don't use subselects, queries with them can usually be rewritten to be faster and more clear.
Comment #4
claudiu.cristea@drumm
The new SQL statement is ANDed the roles... Check it!
In the actual format of the
user.moduleDrupal 5 the records must be obtained in a single SQL query. This is by design... This is the reason why I used sub-queries... There are no options here...Saw that you switched to 7.x-dev? Why? I created the patch against Drupal 5.18.
Comment #5
claudiu.cristeaAttached, the patch for D7...
Comment #7
claudiu.cristeaThis has been fixed in 7.x-dev in other place. Now, in D67, you can filter by more than one role.
The issue is still present in 6.x
Comment #8
claudiu.cristeaToo late for this patch. It's fixed in the current version. 8.x will use Views.