mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Respect default category sort when filter=default (#23411)
Previously we would respect it if the filter was `nil`, but if `default` was explicitly passed then it would ignore the category order settings. This explicit passing of `filter=default` happens for some types of navigations in the JS app.
This extends the fix from 92bc61b4be
This commit is contained in:
@@ -749,7 +749,7 @@ class TopicQuery
|
||||
# category default sort order
|
||||
sort_order, sort_ascending =
|
||||
Category.where(id: category_id).pick(:sort_order, :sort_ascending)
|
||||
if sort_order && (filter.blank? || %w[latest unseen].include?(filter.to_s))
|
||||
if sort_order && (filter.blank? || %w[default latest unseen].include?(filter.to_s))
|
||||
options[:order] = sort_order
|
||||
options[:ascending] = !!sort_ascending ? "true" : "false"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user