# 移动带标签的主题不会提示为新类别添加必需的标签

**URL:** <https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138>\
**Category:** Bug\
**Tags:** tags\
**Created:** [2023 年5 月 7 日 12:27 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138 "2023-05-07T12:27:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://meta.discourse.org/u/sterretje)\
**Post date:** [2023 年5 月 7 日 12:27 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/1 "2023-05-07T12:27:45Z")

</div>

您好

我有一个类别 **one** 和一个类别 **two** （好的，实际上我有更多类别，但我不认为这有什么区别）。

对于类别 **one** ，需要来自标签组_A_的正好一个标签，而来自其他标签组_X_、_Y_和_Z_的标签是可选的。

对于类别 **two** ，需要来自标签组_B_的正好一个标签，而来自标签组_A_、_X_、_Y_和_Z_的标签是可选的。

我可以在类别 **one** 中创建一个包含一个必需标签和两个可选标签的主题，正如预期的那样。接下来，我将此主题从类别 **one** 移动到类别 **two** 。预期的行为是，如果用户未指定来自标签组_B_的必需标签，它将抛出错误。但它并没有这样做，导致类别 **two** 中的主题最终缺少必需的标签 ☹

---

<div class="post-metadata">

**Author:** ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)\
**Post date:** [2023 年5 月 7 日 16:06 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/2 "2023-05-07T16:06:33Z")

</div>

是的，我也看到了版主移动帖子的情况。

---

<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:** [2023 年5 月 8 日 03:32 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/3 "2023-05-08T03:32:10Z")

</div>

我们将在未来四周内解决这个问题。我添加了一个内部标签以优先处理。

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://meta.discourse.org/u/sterretje)\
**Post date:** [2023 年5 月 8 日 06:11 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/5 "2023-05-08T06:11:24Z")

</div>

感谢 @sam

我是这里的新用户，所以如果我问了不恰当的问题，请原谅。这是否只适用于这个错误，还是适用于所有（或至少大部分）已报告的与标记相关的错误？例如，我在过去 10 天里报告了 4 个与标记相关的错误：

1. [Limiting tags to categories not working as expected](https://meta.discourse.org/t/limiting-tags-to-categories-not-working-as-expected/263143)
2. [Editing topics with tag groups from parents allows incorrect tagging](https://meta.discourse.org/t/editing-topics-with-tag-groups-from-parents-allows-incorrect-tagging/263968)
3. [Tags from multiple tag groups required only suggest "select at least one tag"](https://meta.discourse.org/t/tags-from-multiple-tag-groups-required-only-suggest-select-at-least-one-tag/263817)
4. 这个主题

请注意，我并不是想把我的问题推到前面；可能还有更重要的问题需要关注。我只是好奇，如果团队在处理这个问题时，是否会尝试解决所有/大部分问题？

---

<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:** [2023 年5 月 8 日 07:14 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/6 "2023-05-08T07:14:02Z")

</div>

希望我们能全部完成，我们会通知您。

---

<div class="post-metadata">

**Author:** ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)\
**Post date:** [2023 年5 月 15 日 20:37 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/11 "2023-05-15T20:37:44Z")

</div>

@sterretje，

此问题和其他问题应在以下链接中得到修复：

> <https://github.com/discourse/discourse/pull/21490>
>
> \# FIX: Displaying the wrong number of minimum tags in the composer
> 
> When the m…inimum number of tags set for the category is larger than the minimum number of tags set in the category tag-groups, the composer was displaying the wrong value.
> 
> This commit fixes the value displayed in the composer to show the max value between the required for the category and the tag-groups set for the category.
> 
> This bug was reported on Meta in https://meta.discourse.org/t/tags-from-multiple-tag-groups-required-only-suggest-select-at-least-one-tag/263817
> 
> \# FIX: Limiting tags to categories not working as expected
> When a category was restricted to a tag group A, which was set to only allow
> one tag from the group per topic, selecting a tag belonging only to A returned
> other tags from A that also belonged to other group/s (if any).
> 
> Example:
> 
> Tag group A: alpha, beta, gamma, epsilon, delta
> Tag group B: alpha, beta, gamma
> 
> Both tag groups set to only allow one tag from the group per topic.
> 
> If Category 1 was set to only allow tags from the tag group A, and the first tag
> selected was epsilon, then, because they also belonged to tag group B, the tags
> alpha, beta, and gamma were still returned as valid options when they should not be.
> 
> This commit ensures that once a tag from a tag group that restricts its tags to
> one per topic is selected, no other tag from this group is returned.
> 
> This bug was reported on Meta in https://meta.discourse.org/t/limiting-tags-to-categories-not-working-as-expected/263143.
> 
> \# FIX: Moving topics does not prompt to add required tag for new category
> When a topic was moved from a category to another, the tag requirements
> of the new category were not being checked.
> 
> This allowed a topic to be created and moved to a category:
> 
> \- that limited the tags to a tag group, with the topic containing tags
> not allowed.
> \- that required n tags from a tag group, with the topic not containing
> the required tags.
> 
> This bug was reported on Meta in https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138.
> 
> \# FIX: Editing topics with tag groups from parents allows incorrect tagging
> 
> When there was a combination between parent tags defined in a tag group
> set to allow only one tag from the group per topic, and other tag groups
> relying on this restriction to combine the children tag types with the
> parent tag, editing a topic could allow the user to insert an invalid
> combination of these tags.
> 
> Example:
> 
> Automakers tag group: landhover, toyota
> - group set to limit one tag from the group per topic
> 
> Toyota models group: land-cruiser, hilux, corolla
> 
> Landhover models group: evoque, defender, discovery
> 
> If a topic was initially setup with the tags toyota, land-cruiser it was
> possible to edit it removing the tag toyota and adding the tag landhover
> and other landhover model tag like evoque for example.
> 
> In this case the topic would end up with the tags toyota, land-cruiser,
> landhover, evoque because Discourse will automatically insert the
> missing parent tag toyota when it detects the tag land-cruiser.
> 
> This combination of tags would violate the restriction specified in
> the Automakers tag group resulting in an invalid combination of tags.
> 
> This commit enforces that the "one tag from the group per topic"
> restriction is verified before updating the topic tags and also
> make sure the verification check the compatibility of parent tags that
> would be automatically inserted.
> 
> After the changes the user will receive an error similar to:
> The tags land-cruiser, landhover cannot be used simultaneously.
> Please include only one of them.
> 
> This bug was reported on Meta in https://meta.discourse.org/t/editing-topics-with-tag-groups-from-parents-allows-incorrect-tagging/263968.

---

<div class="post-metadata">

**Author:** ![sterretje](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sterretje](https://meta.discourse.org/u/sterretje)\
**Post date:** [2023 年5 月 16 日 10:05 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/13 "2023-05-16T10:05:57Z")

</div>

此问题已解决 👍

**移动前**

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/2/4/c24e9aa1af7d6e5f14d0cb0f81eb7c1070650570.png)

**移动；请勿更改标签**

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/f/9/8f99e02a4ef9e11fbd149b18a5ffbd989d6e18c5.png)

**点击标签下拉菜单**

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/6/5/d6524268261972e24cb618e349592c87cf52cb84.png)

我只需要告知版主需要额外检查标签的步骤；他们不会高兴的 😉

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023 年5 月 16 日 10:15 UTC](https://meta.discourse.org/t/moving-tagged-topics-does-not-prompt-to-add-required-tag-for-new-category/264138/14 "2023-05-16T10:15:25Z")

</div>


