jomaxro reported a bug in Discourse 1.7.0.beta5 where a tag (e.g., crafting) cannot be recreated after being removed from all topics if a similar tag with an underscore (e.g., crafting_suggestion) exists. The user attempted to rename the existing tag to the removed one but received a “name has already been taken” error. codinghorror assigned the issue to neil, who initially could not reproduce it. However, GSeven confirmed the issue, noting it occurs when renaming a tag to a name that exists but is not currently visible because it has zero topics. neil explained that unused tags are not automatically deleted to allow for pre-defined tag groups; the error was truthful because the tag still existed in the system. He provided a workaround: navigate to /tags/[tag_name] to delete the hidden tag, then rename the other tag. GSeven confirmed this solution worked. However, jomaxro clarified that while the specific crafting case was resolved, the core issue persists for other tags like performance. They argued that users should not be required to manually clean up /tags pages to resolve this, suggesting the system should automatically remove unused tags or prevent this specific conflict more gracefully.
Summary: Over at Stonehearth we previously created tags like crafting and crafting_suggestion. Doing some cleanup, crafting was removed from all topics. Now we cannot recreate the tag.
Steps to reproduce:
Add a tag to a topic
Add a different tag to a topic that has two words separated by an underscore and one word being the above created tag.
Remove the tag from #1 from all topics “deleting” the tag.
Attempt to add the tag back to a topic.
Expected Results:
Tag is added to topic.
Actual Results:
Tag does not appear as an option
Notes:
This is likely an issue even if step 1 is skipped, but I haven’t tested it.
I can reproduce it Neil.
The key, which isn’t clear, is to press Rename Tag.
Remove the first tag from a topic. (crafting)
Click the second tag, (crafting_stuff) - and Rename Tag to ‘crafting’.(.com/tags/crafting_stuff)
Name has already been taken. Tag page shows no ‘crafting’ tag
I think the mistake is the assumption that removing “crafting” has deleted it. The error “name has already been taken” is telling the truth. There was a problem where unused tags were not being shown anywhere, which is probably why you thought they were deleted. I fixed that today. So you can find it on your /tags page or navigate to /tags/crafting and delete it.
We don’t automatically delete tags because we allow you to pre-define them. For example you can setup your tag groups like so:
gotcha, that makes sense, so even though on the tags page an unused but created tag doesn’t show, it’s still in the system and will show on the tags page once it is added to a post.
nice-one!
So i guess the OP should edit each post and add the ‘crafting’ tag, rather than renaming the exisiting ‘crafting_suggestion’ tag.
@neil, @GSeven thanks for the great discussion, however, I don’t think this actually addressed the issue I was seeing.
@neil, I think I understand the (now fixed) issue with tags not fully being removed. Assuming that was what was happening, then I shouldn’t have had an issue here. I resolved the issue with crafting by deleting the crafting tag from /tags/crafting and then was able to use it again. I was not trying to rename crafting_suggestions to crafting, I was trying to rename craftin (a temporary tag I created) to crafting.
The issue is still occurring at Stonehearth right now, try to create a topic with the performance tag. It is not being allowed: