# 当更改计划在同一类别中发布的帖子的类别时发出警告

**URL:** <https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590>\
**Category:** Feature\
**Created:** [2021年二月13日 18:07 UTC](https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590 "2021-02-13T18:07:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)\
**Post date:** [2021年二月13日 18:07 UTC](https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590/1 "2021-02-13T18:07:02Z")

</div>

我注意到可以这样操作：

1. 在类别 A 中创建一个主题
2. 将该主题安排为第二天发布到类别 B
3. 将主题的分类编辑为类别 B

在主题底部会显示“此主题将在 24 小时后发布到 #类别 B"，即使该主题已经位于该类别中。

对于以下流程也是如此：

1. 在类别 B 中创建一个主题
2. 将该主题安排为第二天发布到类别 B

我认为更合理的做法是：

- 当计划发布的类别与目标类别（流程 1）或当前类别（流程 2）一致时发出警告，或者
- 移除发布通知（在流程 1 中），或不允许保存该计划（在流程 2 中）。

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2021年二月13日 22:59 UTC](https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590/2 "2021-02-13T22:59:53Z")

</div>

这算是自找的麻烦，但我确实同意，如果工作量不大的话，这种情况下我们应该显示一个警告。@eviltrout，你能否在下周评估一下所需的工作量？

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2021年二月16日 15:54 UTC](https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590/3 "2021-02-16T15:54:10Z")

</div>

如果分类相同，我们可以很轻松地显示警告。我估计只需要几个小时的工作量。@riking 你能看一下吗？

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2021年二月18日 22:35 UTC](https://meta.discourse.org/t/warn-when-changing-a-topics-category-when-its-scheduled-to-be-published-in-the-same-category/179590/5 "2021-02-18T22:35:24Z")

</div>

看起来 @dan 已经为共享草稿的情况修复了这个问题：

> <https://github.com/discourse/discourse/commit/c3bab3ef3816ba17e1a9a9c64582fc2e2336a8f1>
>
> It used to change the category of the topic, instead of the destination
> categor…y (topic.category\_id instead of topic.shared\_draft.category\_id).
> 
> The shared drafts controls were displayed only if the current category
> matched the 'shared drafts category', which was not true for shared
> drafts that had their categories changed (affected by the previous bug).

我可能应该在这里复制那个模型——将分类编辑保存到计划操作中。
