Continuing the discussion from Sorting by creation date doesn't work :
The category/tag links on the homepage/sidebar (class=“subcategory”) load the category using /latest.json
. It doesn’t appear on the URL, but you can see it in the Network tab:
This means that the topics in the category will be sorted by latest activity.
If the category has a setting with a different order, it is not honored.
To see the default order, you have to reload the page. Example: category 25 with order “created descending”:
3 Likes
Just to confirm that we’ve been able to replicate this and we’re looking into it.
2 Likes
I think this is fixed now in:
discourse:main
← discourse:default-sort-order
opened 03:41PM - 25 Aug 23 UTC
When navigating around, we make ajax requests with a parameter like `?filter=lat… est`. This results in the TopicQuery being set up with `filter: "latest"` as a string. The logic introduced in fd9a5bc0 checks for equality with `:latest` and `:unseen` symbols, which didn't work correctly in this situation
This commit makes the logic detect both strings and symbols, and adds a spec for the behaviour.
4 Likes
@JammyDodger @david I just upgraded and the issue is still there. To reproduce:
Set a category’s default order to “Created Descending”
Click on that category’s link on the homepage/sidebar
Expected behavior: topics sorted by descending created date.
Actual behavior: topics sorted by descending modified date.
Reload the page
Expected behavior: topics remain sorted by descending modified date.
Actual behavior: topics are now correctly sorted by descending created date.
1 Like
david
(David Taylor)
September 5, 2023, 8:58pm
8
Hi @Nacho_Caballero - I just pushed a second fix which should get things working as expected:
committed 06:05PM - 05 Sep 23 UTC
Previously we would respect it if the filter was `nil`, but if `default` was exp… licitly 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 92bc61b4be9242dd0242ed60641a5129938a231a
Please let us know if you’re still seeing any problems after updating.
5 Likes
Thanks for the great work, David. Now it works perfectly.
4 Likes
david
(David Taylor)
Closed
September 11, 2023, 7:00am
11
This topic was automatically closed after 5 days. New replies are no longer allowed.