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

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 Likes

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

4 Likes

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 Likes

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 Likes

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 Like

When one of the replies is marked incorrectly as the correct answer, then the admin sees that the category is wrong and moves the topic to another category. The marked replay is still displayed as the correct answer, even if this feature is not enabled in the new category.
In these cases, the admin can not cancel the marked replay. It should change the category to where this feature is enabled. Cancel the correct answer and change the category again.

It would be a little easier if managers could cancel the correct answer in all categories (even those with this feature turned off).

We have addressed this by ensuring that if a solution post is moved out of the topic, the topic returns to unsolved state.

The user that is moving the solution post is notified of the impact before they complete the move action:

3 Likes

To me, that looks like a fix for Carelessly splitting a solved post to a new topic breaks things

It doesn’t seem to fix the problem described in the OP which talks about a whole topic being moved to another category where solutions aren’t enabled, not about moving a few posts to another topic. When I move `personal_messages:username` search filter doesn't work, which is a solved topic, to Feature where solutions are not allowed, the solution isn’t removed, and there is no warning.

It addresses this problem:

But I can see there is more to the problem so we can keep this open.

Hmm, I still don’t understand. Isn’t that what I just tried?

A topic marked as solution

I chose this topic that was marked as solved `personal_messages:username` search filter doesn't work

which is moved out of a category with solutions

I moved it to Feature where solutions are not enabled

remains marked as solution (and cannot be unchecked as such)

And it was still marked as solved. What did the fix change in this process?

2 Likes

Sorry, I see what you’re saying now. I was reading this wrong, as a post marked as solution which is moved out of a category.

I’ll queue this one up to fix, though, because I think it should be a small enhancement to the work we did with the solved post.

3 Likes