When moving a solved topic to a category that disallows solutions, remove solved

AI 生成的摘要

The discussion addresses a bug where moving a solved topic to a category that disallows solutions failed to remove the “solved” status. codinghorror initially reported the issue, noting that topics moved out of categories with solutions retained their solved markers. sam agreed to the cleanup, and bekicot submitted a PR adding a plugin hook to handle category changes. tgxworld suggested using a model callback instead of a new event trigger. fhe and nildarar confirmed the issue persisted, explaining that admins could not uncheck the solution after moving the topic to an incompatible category. lindsey initially claimed a fix was in place, but Moin clarified that the previous fix only addressed moving individual posts, not entire topics. lindsey acknowledged the misunderstanding and lindsey committed to fixing the topic-level issue. Finally, lindsey confirmed the behavior was updated: when a solved topic is moved to a category without solution support, the accepted solution is automatically removed, and admins receive a notification before the move is completed.

I’ve seen this too when moving topics out of a category where solved was set, any way to fix this @sam?

  • When moving a topic out of a category with solutions, remove solved stuff

  • When moving a topic into a category with solution, make solved possible

2 个赞

Agree, we should get this cleaned up, for now pr-welcome

4 个赞

Added Trigger DiscourseEvent when topic category is changed by bekicot · Pull Request #4785 · discourse/discourse · GitHub, so that plugin can hook into :topic_category_changed. I think it is required in order to fix this issue.

5 个赞

Thanks for the PR @bekicot :thumbsup:

I was just curious but is it possible to avoid adding a DiscourseEvent trigger and just add a model callback which checks when the category_id has been changed?

2 个赞

Seems like this is still happening.

A topic marked as solution which is moved out of a category with solutions remains marked as solution (and cannot be unchecked as such)

1 个赞

当某条回复被错误地标记为正确答案时,管理员会发现分类有误,并将该主题移至另一个分类。即使在新分类中未启用该功能,被标记的回复仍会显示为正确答案。
在这些情况下,管理员无法取消该标记。他们需要先更改分类至已启用该功能的类别,取消正确答案标记,然后再更改回原分类。

如果管理员能够在所有分类中(包括未启用该功能的分类)取消正确答案标记,情况会稍微简单一些。

我们通过确保如果解决方案帖子从主题中移出,主题将恢复为未解决状态来解决此问题。

移动解决方案帖子的用户在完成移动操作之前会收到有关影响的通知:

4 个赞

在我看来,这看起来像是针对 Carelessly splitting a solved post to a new topic breaks things 的修复。

它似乎并没有修复原帖中描述的问题。原帖讨论的是将整个主题移动到未启用“解决方案”功能的另一个分类,而不是将几篇帖子移动到另一个主题。当我将 https://meta.discourse.org/t/personal-messages-username-search-filter-doesnt-work/371848(这是一个已解决的主题)移动到 Contribute > Feature(不允许使用解决方案)时,解决方案并未被移除,也没有出现任何警告。

它解决了这个问题:

但我认为问题还有更多,所以我们可以保持这个开放。

嗯,我还是不太明白。这难道不是我刚才试过的操作吗?

标记为已解决的帖子

我选择了这个被标记为已解决的帖子 `personal_messages:username` search filter doesn't work

该帖子已从启用了“已解决”功能的分类中移出

我将它移到了 Contribute > Feature,那里并未启用“已解决”功能

仍然被标记为已解决(且无法取消该标记)

它依然显示为已解决状态。这个修复究竟改变了处理流程中的哪些部分?

2 个赞

抱歉,我现在明白你的意思了。我之前将此视为一个移出分类的标记为解决方案的帖子。

不过,我会将此项排队修复,因为我认为这应该对我们对已解决帖子所做的工作进行一次小的改进。

3 个赞

我们已更新此行为,以便当已解决的主题被移动到不支持解决方案的类别时,已接受的解决方案将从该主题中移除。在管理员完成移动之前,我们会通知他们:

5 个赞

此主题在 2 天后自动关闭。不再允许回复。