Is it expected that I can create a tag and a category whose slugs are exactly equal?
Of the issues, it leads the category being shown in the Tags page (where all tags are listed).
Is it intentional?
A discussion on Category and Tag that have the same slug revealed an unexpected behavior. meglio noticed that when a tag and category share the same slug, the category is shown on the Tags page, along with the tag. tobiaseigen initially couldn’t reproduce the issue but later confirmed it after meglio provided steps to replicate.
It appears that the category is shown on the Tags page because the tag is restricted to that category. meglio understood this behavior, realizing that the category is displayed to indicate the tag’s restriction. tobiaseigen considered this a useful feature rather than a bug, suggesting that it could be helpful to have a list of tags for each category directly on the Tags page.
Is it expected that I can create a tag and a category whose slugs are exactly equal?
Of the issues, it leads the category being shown in the Tags page (where all tags are listed).
Is it intentional?
I just did a test and don’t see any problem with this, unless there is something to it that I am missing. You can have tags that are categories and vice versa, no problem. It’s not the category that is shown in the tags page, but the tag.
And otherwise there is no conflict at all, with URL paths or anything else.
@tobiaseigen Actually, both category and tag are shown.
I’m using the latest Discourse, so should be a reproduction issue.
Try
I haven’t tried with any, but I thought this behaviour is weird and is worth reporting. Not sure if it can be considered a ux bug.
I have not seen this before but I can see how it might be useful to have a list of tags for each category directly on the tags page under a link to the category itself. The fact that they can be the same is not a bug, no.
Thanks for looking into it!
Ah! So it shows the category just to indicate the tag is restricted to that category!