Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#571 closed defect (bug) (wontfix)

Members widget - sorting by 'Newest' not always reliable

Reported by: johnbillion's profile 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)

571.patch (1.2 KB) - added by johnbillion 15 years ago.
patch

Download all attachments as: .zip

Change History (6)

@johnbillion
15 years ago

patch

#1 @apeatling
15 years ago

  • Milestone set to Core 1.0

#2 @apeatling
15 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.

#3 @johnbillion
15 years ago

  • Keywords dev-feedback added; removed

This SQL query now has a filter on it ('bp_core_newest_users_sql') so anyone experiencing the same issue can filter the query and remove the word 'DISTINCT'.

Recommending as WONTFIX due to the edge case nature and a workaround being available.

#4 @apeatling
15 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks.

#5 @(none)
15 years ago

  • Milestone Core 1.1 deleted

Milestone Core 1.1 deleted

Note: See TracTickets for help on using tickets.