# Bulk tag actions not working in tag view with category restrictions

**URL:** <https://meta.discourse.org/t/bulk-tag-actions-not-working-in-tag-view-with-category-restrictions/125782>\
**Category:** Bug\
**Tags:** bulk-actions\
**Created:** [August 14, 2019, 2:49pm UTC](https://meta.discourse.org/t/bulk-tag-actions-not-working-in-tag-view-with-category-restrictions/125782 "2019-08-14T14:49:11Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

The discussion highlights a bug where bulk tag actions fail when performed within a tag view that has category restrictions, despite the topics being in the correct category. [davidkingham](/t/-/125782/1) reports that appending or replacing tags in this context triggers an error stating the tag is restricted to a specific category, even though the topic belongs to that category. The user notes that the same bulk action works correctly when executed within the category view itself. [simon](/t/-/125782/3) confirms the issue, reproducing it on a development site with tags restricted to the 'scratch' category. He demonstrates that attempting to append a restricted tag from the tag view (`/tags/foo` or `/tags/c/scratch/foo`) results in an error message, whereas performing the action directly within the category (`/c/scratch`) succeeds without issues. This indicates a discrepancy in how category restrictions are validated between tag views and category views during bulk operations.

<div class="post-metadata">

**Author:** ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)\
**Post date:** [August 14, 2019, 2:49pm UTC](https://meta.discourse.org/t/bulk-tag-actions-not-working-in-tag-view-with-category-restrictions/125782/1 "2019-08-14T14:49:11Z")

</div>

When appending or replacing tags in a tag view and the tag has category restrictions it does not behave as expected, it gives an error that the tag is restricted to a category, but as you can see below the topic is in that category. If I use the bulk action within the category rather than the tag view it works as expected.

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/6/3603aaa726852aa146264a28f8de89de7f899fcd.png)

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [August 14, 2019, 6:57pm UTC](https://meta.discourse.org/t/bulk-tag-actions-not-working-in-tag-view-with-category-restrictions/125782/3 "2019-08-14T18:57:03Z")

</div>

I can reproduce this on my development site. I have restricted the tags `foo` and `bar` to the ‘scratch’ category. If I go to `/tags/foo`, or `/tags/c/scratch/foo`, and try to append the `bar` tag, I get the error message '“bar” is restricted to the “scratch” category '.

If I go to `/c/scratch`, I can append the tag `bar` to the topics without any problem.
