Bug in changing post ownership

  1. New topic created by staged user via email in
  2. Somebody (A) replied
  3. Admin goes in and change ownership of that reply to somebody else (B)
  4. The first post (i.e. the topic) owner got changed to (B) as well

Also some change ownership strangeness:

This cannot be right…

3 Likes

Actually, the number of posts in the text Please choose the new owner of the [n] posts by... keeps increasing. From one to two to three and so on…

All you need is keep clicking on the Change Ownership button, bringing up the modal dialog, then dismissing it. It will keep adding posts to the list, even when you dismiss the dialog every time.

And worse, go out and click on another topic, and do the same. The numbers KEEP ADDING. The only way out of this is to reload the site.

Someone has forgotten to clear some array in JavaScript when the dialog is dismissed…

1 Like

https://github.com/discourse/discourse/blob/0fca5ed533a123d75c45c84375199ac2079c9ca3/app/assets/javascripts/discourse/controllers/topic.js.es6#L682-L685

I wonder whether selectedPosts should get cleared if the Change Ownership dialog is dismissed?

As it stands right now, it keeps adding into the list.

SelectedPostsCount assumes that all the selectedPosts all have the same user; if not, it chokes and show the above error for missing old_user.

1 Like

Just pushed a fix :hamburger:

https://github.com/discourse/discourse/commit/c63ecd87f20feb50146633fde3a3e51c277dfba0

3 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.