#571 closed defect (bug) (wontfix)
Members widget - sorting by 'Newest' not always reliable
Reported by: | johnbillion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | minor | |
Severity: | Version: | 1.0 | |
Component: | Keywords: | members, mysql, newest, sorting, dev-feedback | |
Cc: | johnbillion |
Description
I get the feeling I might have a hard job getting people to reproduce this one.
One (out of five) of my BuddyPress installations is not sorting the list of 'Newest' members in the Members widget correctly. See the widget on the front page of http://gaatalk.net/ . MySQL is returning the results unordered even though the query is thus:
SELECT DISTINCT ID as user_id, DATE_ADD( user_registered, INTERVAL 0 HOUR ) as user_registered FROM wp_users WHERE spam = 0 AND deleted = 0 AND user_status = 0 ORDER BY user_registered DESC
(The query can be found on line 131 of bp-core/bp-core-classes.php
)
The results should be sorted by user_registered
descending. After some tinkering, I found that it will correctly return the results ordered by user_registered
if DISTINCT is removed from the query.
As ID
is an auto_increment column, DISTINCT can be removed from the query without side effect. Any chance this could be considered?
Attachments (1)
Change History (6)
#2
@
16 years ago
- Milestone changed from Core 1.0 to Core 1.1
I seem to recall this causing negative side effects when using that query in other places. I'm bumping this to 1.1 for consideration.
patch