Changing category - "this topic has tags that aren't allowed"

When changing the category of a topic, if the topic has tags that aren’t allowed the new category, it doesn’t let me update the category. This is fine – however if I then try to delete those tags and update the category and tags again at the same time, it says that those tags are still there and doesn’t let me upload.

To get around this, I have to delete the tags, refresh the page, and then change the topic.

I have a screen recording of the issue if you allow me to upload a .mov file. :slight_smile:

5 Likes

Do you mean “if the post has tags that aren’t allowed in the new category”?

1 Like

Yes, exactly, whoops (I often confuse categories and topics)

3 Likes

@codinghorror were you able to replicate this? Let me know if you want more info or the video.

I can reproduce the issue. The notice I get after deleting any tags that are not allowed, and then trying to re-categorize the topic is:

image

The quotes in that screenshot are two single quotation marks.

If at the same time as deleting the tag, I also add a tag that is allowed by the category, I am able to re-categorize the topic without any issue.

3 Likes

This is really odd @joffreyjaffeux - can you investigate? A quick peek at the code indicates that it has an empty? check already for this message so I wonder if the tags parameter might be treated as a string instead of a list of values.

5 Likes

That should do it, I also solved another bug, simplified code and added specs while at it:

https://github.com/discourse/discourse/pull/7921

5 Likes