# Tags not visible to user can no longer be used

**URL:** <https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532>\
**Category:** Feature\
**Created:** [March 7, 2017, 9:37am UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532 "2017-03-07T09:37:03Z")\
**Posts on this page:** 10\
**Page:** 1

## AI-generated summary

[@jomaxro](/t/-/58532/1) reported that recent updates to Discourse tag support, which restrict tag filters to visible tags within a category, inadvertently broke a workaround where staff created tags in hidden topics for public use. Users lacking permissions to view those staff topics could no longer utilize those tags. [@pfaffman](/t/-/58532/2) suggested using an unlisted topic instead. [@jomaxro](/t/-/58532/1) initially misunderstood credit, thanking [@sam](/t/-/58532/3) before [@neil](/t/-/58532/4) clarified he made the changes. Upon reviewing the issue, [@neil](/t/-/58532/5) identified it as a bug in the tag search API, which was incorrectly filtering tags by category regardless of user permissions. He confirmed a fix was committed. While the workaround of using an unlisted topic in an open category works, [@neil](/t/-/58532/9) assured [@jomaxro](/t/-/58532/8) that the fix applies only to the tag input field and will not affect the new feature of category-specific tag filtering.

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [March 7, 2017, 9:37am UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/1 "2017-03-07T09:37:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [March 7, 2017, 2:54pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/2 "2017-03-07T14:54:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [March 7, 2017, 3:17pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/3 "2017-03-07T15:17:37Z")

</div>

> [@jomaxro](#):
>
> Recently, @Sam’s done some great work updating tags support in Discourse.

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

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [March 7, 2017, 3:35pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/4 "2017-03-07T15:35:36Z")

</div>

> [@sam](#):
>
> Totally agree @neil made some awesome changes to tag support in Discourse.

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.

* * *

> [@pfaffman](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [March 7, 2017, 4:18pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/5 "2017-03-07T16:18:02Z")

</div>

> [@jomaxro](#):
>
> 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).

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”…

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [March 7, 2017, 4:27pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/6 "2017-03-07T16:27:51Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [March 7, 2017, 4:51pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/7 "2017-03-07T16:51:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [March 7, 2017, 4:53pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/8 "2017-03-07T16:53:49Z")

</div>

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

> [@jomaxro](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [March 7, 2017, 4:55pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/9 "2017-03-07T16:55:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [March 8, 2017, 3:49pm UTC](https://meta.discourse.org/t/tags-not-visible-to-user-can-no-longer-be-used/58532/10 "2017-03-08T15:49:15Z")

</div>

Closed on March 8, 2017, 3:49pm UTC


