Merge pull request #6772 from rxu/ticket/17227

[ticket/17227] Fix rows duplication in memberlist
This commit is contained in:
Marc Alexander 2025-03-01 15:47:55 +01:00 committed by GitHub
commit 08fd9caa11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1390,10 +1390,10 @@ switch ($mode)
$order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); $order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
// Unfortunately we must do this here for sorting by rank, else the sort order is applied wrongly // For sorting by non-unique columns (rank, posts) add unique sort key to avoid duplicated rows in results
if ($sort_key == 'm') if ($sort_key == 'm' || $sort_key == 'd')
{ {
$order_by .= ', u.user_posts DESC'; $order_by .= ', u.user_id ASC';
} }
/** /**