A note here, this can be repro-ed on Meta.
2 likes
Thanks for the report @哈基米曼波 This should fix the issue
main ← fix-category-switch-with-no-tags-filter
merged 07:32PM - 12 May 26 UTC
When a user opened a category, selected "No tags" in the tag dropdown, and then … picked another category from the breadcrumb, they landed on a 404 page instead of the new category with the "No tags" filter preserved.
The breadcrumb's `CategoryDrop` passes its `tag` argument straight to `getCategoryAndTagUrl`. On a `/tags/c/<slug>/<id>/none` page that `tag` is a `Tag` model with `slug: "none"` and `id: null` — not the literal string `"none"` that `TagDrop` passes from its own handler. The URL builder unconditionally appended `tag.slug + "/" + tag.id`, producing `/tags/c/<new-slug>/<new-id>/none/null`, which no route can resolve.
This normalizes the tag handling in `getCategoryAndTagUrl` so that any tag without an `id` (the "no tags" filter, whether expressed as a string or as a Tag model) renders as `.../<slug>` instead of `.../<slug>/null`. The category branch is also tidied up — it had an unreachable inner `else` because the outer condition already required `subcategories` to be true.
https://meta.discourse.org/t/402545
2 likes