FIX: `default_tags_muted` site setting won't have tag ids.

FIX: default_tags_muted site setting won’t have tag ids.

Instead it only have list of tag names separated by comma. 89fcb75af2b8abfd146ab9b70895db466c0d2a9d

diff --git a/lib/topic_query.rb b/lib/topic_query.rb
index bef2eb3..ec6133c 100644
--- a/lib/topic_query.rb
+++ b/lib/topic_query.rb
@@ -917,7 +917,8 @@ class TopicQuery
     if user.present?
       muted_tag_ids = TagUser.lookup(user, :muted).pluck(:tag_id)
     else
-      muted_tag_ids = SiteSetting.default_tags_muted.split("|").map(&:to_i)
+      muted_tag_names = SiteSetting.default_tags_muted.split("|")
+      muted_tag_ids = Tag.where(name: muted_tag_names).pluck(:id)
     end
 
     if muted_tag_ids.blank?
diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb
index d36b7cd..0b238cb 100644
--- a/spec/components/topic_query_spec.rb
+++ b/spec/components/topic_query_spec.rb
@@ -286,7 +286,7 @@ describe TopicQuery do
 
       before do
         SiteSetting.remove_muted_tags_from_latest = 'always'
-        SiteSetting.default_tags_muted = tag.id.to_s
+        SiteSetting.default_tags_muted = tag.name
       end
 
       it 'removes default muted tag topics for anonymous users' do

GitHub sha: 618a7ecb

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/mute-tag-in-settings-seems-to-be-broken-the-muted-tag-topics-still-show-up-in-the-latest/159893/17