Re-order merged posts

AI-generated summary

Re-order merged posts: Loki is seeking a way to reorder merged posts by creation date. HAWK believes this is not possible, but notes that it’s unlikely to be noticed. Loki shares a specific instance where the current behavior caused an issue. pfaffman explains that posts are pulled in post-id order due to performance concerns. However, JammyDodger suggests a rake task rake posts:reorder_posts or rake "posts:reorder_posts[TOPIC_ID]" that can reorder posts by creation date for a specific topic.

We merged some threads and were hoping the order of the posts in the result would the order of post creation. But they are not. Is there any way to re-order them into creation order, or at least be sure they stay in creation order next time we merge?

Found this related topic, but it’s closed:

AFAIK there is no way to change this behaviour, no. In good news, it’s likely that no one will notice.

Actually, we merged three fairly long moderator topics about one individual that was causing problems. It made it really hard to follow the flow of what had transpired and caused the boss to make a mistake in dealing with that individual. Oh well, won’t be doing that again.

Posts get pulled in post-id order. Pulling in another order would be a performance issue, and would only be useful in the very rare edge case. . . that you managed to find.

There is a rake task that may help in these situations:

cd /var/discourse

./launcher enter app

rake posts:reorder_posts

That task will set the order of all posts on your site according to when they were created.

And to target it to a specific topic instead:

rake "posts:reorder_posts[TOPIC_ID]"