Sorting by name on tag page

AI-generated summary

Users reported a bug where tags on the tag page fail to sort alphabetically by name, appearing random or ordered by ID instead. jenroberts noted the issue persists across sites since the December rollout of direct tag creation. Moin confirmed the tags are likely ordered by ID and provided screenshots comparing the incorrect display with data explorer results. chapoi suggested a fix via a pull request (PR #37339). However, Moin identified this as a partial fix, noting that the Tags sort alphabetically site setting still results in incorrect ordering. They hypothesized that the controller logic at a specific line in tags/index.js still references ID instead of name. zogstrip acknowledged the catch and linked a follow-up pull request (PR #37363) intended to resolve the remaining issue.

Since the new feature to be able to create tags directly on the tag page was rolled out in December, I can’t seem to get the tags to sort by name. Count works fine, but Name seems to be completely random. I thought it might just be my site, but it is doing the same thing on Meta (see below). Is there a setting I’m missing or is this a bug?

4 Likes

I think this is a bug. The tags seem to be ordered by ID instead of name when you select “name”.

2 Likes

This will solve it I think

https://github.com/discourse/discourse/pull/37339/changes

3 Likes

I think this is only a partial fix: It works fine when I use the “name” button at the top, but the order is still wrong when the Tags sort alphabetically site setting is enabled and you open the tag page, even though “names” is selected then too.

Maybe the “id” here also needs to be changed to “name”?

Good catch, that should fix it

https://github.com/discourse/discourse/pull/37363

3 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.