Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect tags_sort_alphabetically setting #19

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

gormus
Copy link
Collaborator

@gormus gormus commented Jul 2, 2024

Currently the /topic_composer/tag_by_tag_group/{tag}.json feeds are not sorted.

Proposed change allows the sorting tags alphabetically when the tags_sort_alphabetically setting is turned on.

Offenses:

app/controllers/discourse_preset_topic_composer/preset_tag_groups_controller.rb:17:71: W: [Correctable] Lint/SafeNavigationChain: Do not chain ordinary method call after safe navigation operator.
      tags = TagGroup.visible(guardian).find_by(name: tag_group)&.tags.order(tag_order) || []
                                                                      ^^^^^^^^^^^^^^^^^
@Grubba27 Grubba27 merged commit 4c49bcd into discourse:main Jul 2, 2024
4 checks passed
@gormus gormus deleted the tags_sort_alphabetically branch July 2, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants