Tags not visible to user can no longer be used


(Joshua Rosenfeld) #1

Recently, @Sam’s done some great work updating tags support in Discourse. One of the best new features (in my opinion) is that the tag filter in a category only shows the tags used in that category - removing the “no topics match the filters” issue that use to be able to occur.

However, this change has broken a specific use of tags that relied on said flexibility. In the past, when a site wanted to have staff control tag creation, but wanted to have all the tags always available, it was recommended to make a #staff topic, create the tags you need, and then they could be used by users. With the new change, this doesn’t work anymore. As users can’t see the tags (they can’t see staff topics), they can’t use the tags (as they don’t have create tag permissions).


Is there a new procedure to accomplish this? This was a critical feature (or side-effect) that a site I administer used fully, and now does not work.

Suggested solution: create a site setting called global tags (or similar) which allows for admins to create tags (just like staff tags are created). These global tags can be seen and used by all users with the appropriate trust level to use tags, regardless of if they’re in use yet.


(Jay Pfaffman) #2

Could you put those tags in a topic that’s not indexed? (I forget the word we use for that.) you’d the link to that hidden topic (maybe that’s what we call it) in the old staff topic.


(Sam Saffron) #3

cough by @sam you mean @neil. Totally agree @neil made some awesome changes to tag support in Discourse.


(Joshua Rosenfeld) #4

My sincere apologies @neil - I did a quick scan on the commit log to, and saw Sam’s commit cleaning up tags extensibility and assumed incorrectly.


That’s a good idea Jay, I’ll give that a whirl and see!


(Neil Lalonde) #5

That sounds like a bug. I don’t remember having a rule that “if you can’t see a tag, you can’t use it”…


(Joshua Rosenfeld) #6

@neil, I’m glad to hear that this is likely a bug. Here are my repro steps (from my dev instance):

  1. Create 2 users: User A has admin rights, user B is TL1.
  2. Modify tag settings. I changed the following (doubt the all matter, but in the interest of thoroughness):
  • tagging enabled : true
  • max tags per topic : 25
  • show filter by tag : true
  • tags sort alphabetically : true
  1. As User A, add 5 tags to a topic titled Tag Topic - DO NOT DELETE located in the pre-seeded Staff category.
  • I added the following tags: feedback, question,issue, tip, and idea
  1. As User B, create a new topic and click on the choose optional tags for this topic field.
  • No tags appear in the dropdown field, simply see No matches found.

Edit: I forgot to mention that @pfaffman’s idea did work - putting the tags on an unlisted topic in an open category does work. That being said, I’d much prefer to have the topic fully secure (and non-public) in a staff category than potentially locatable as an unlisted topic.

Thanks Jay for the tip!


(Neil Lalonde) #7

I committed a fix. It was a bug in the tag search API. The tags were allowed, but search was filtering by category for no good reason.


(Joshua Rosenfeld) #8

Sounds great! I hope this doesn’t “break” the amazing new feature I mentioned above?


(Neil Lalonde) #9

It won’t affect anything outside of tag search, which is only used by the tag input field of the composer.


(Neil Lalonde) #10