Skip to content

A platform for community discussion. Free, open, simple.

FIX: 404s on 'no tags' (#37793)

Natalie Tay91147d83019c
diff --git a/frontend/discourse/app/routes/tag/show.js b/frontend/discourse/app/routes/tag/show.js
index ec44a49d0c7..9464d781b62 100644
--- a/frontend/discourse/app/routes/tag/show.js
+++ b/frontend/discourse/app/routes/tag/show.js
@@ -127,6 +127,8 @@ export default class TagShowRoute extends DiscourseRoute {
transition.to.queryParams["category"]
);
}
+ } else if (slug === NONE) {
+ filter = `tag/${NONE}/l/${topicFilter}`;
} else {
// use ID-only format for API calls
filter = `tag/${id}/l/${topicFilter}`;
diff --git a/frontend/discourse/tests/acceptance/tags-test.js b/frontend/discourse/tests/acceptance/tags-test.js
index dad67721274..92cd60155b0 100644
--- a/frontend/discourse/tests/acceptance/tags-test.js
+++ b/frontend/discourse/tests/acceptance/tags-test.js
@@ -774,7 +774,7 @@ acceptance("Tag show - create topic", function (needs) {
},
});
});
- server.get("/tag/0/l/latest.json", () => {
+ server.get("/tag/none/l/latest.json", () => {
return helper.response({
users: [],
primary_groups: [],
diff --git a/spec/system/tags/tags_spec.rb b/spec/system/tags/tags_spec.rb
index b2b555dd156..ec33f6a2ff2 100644
--- a/spec/system/tags/tags_spec.rb
+++ b/spec/system/tags/tags_spec.rb
@@ -148,6 +148,19 @@ describe "Tags", type: :system do
expect(page).to have_current_path("/tag/#{tag_one.slug}/#{tag_one.id}")
expect(discovery.topic_list).to have_topic(topic_with_one_tag)
end
+
+ it "filters to untagged topics when selecting 'no tags' from tag drop" do
+ sign_in(user_tl1)
+ visit "/latest"
+
+ discovery.tag_drop.expand
+ discovery.tag_drop.select_row_by_value("no-tags")
+
+ expect(page).to have_current_path("/tag/none")
+ expect(discovery.topic_list).to have_topic(topic_with_no_tags)
+ expect(discovery.topic_list).to have_no_topic(topic_with_one_tag)
+ expect(discovery.topic_list).to have_no_topic(topic_with_two_tags)
+ end
end
describe "create/edit topics and PMs with tags" do