Hmm, maybe I'm reporting a different bug then?

Here's what happened with me. I had two topics, say topic A and topic B.

Topic A had 6 replies:

A.0, A.1, A.2, A.3, A.4, A.5

Topic B had 0 replies (i.e. just the single post):

B.0

I merged Topic A to Topic B, and when viewing the end result in Flat Mode, I got the following:

A.0, B.0, A.1, A.2, A.3, A.4, A.5

What I expected to see was:

B.0, A.0, A.1, A.2, A.3, A.4, A.5

Looking in showflat.php, I notice that the main query just sorts by the Post ID, which is effectively sorting chronologically:

Code
ORDER BY POST_ID

But this doesn't guarantee that the main parent post of a topic gets displayed first! As shown in my example above.

So I changed it such that the main parent post will always appear first, and then the remaining posts are in chronological order:

Code
ORDER BY POST_IS_TOPIC DESC, POST_ID

So, I still think I have found a bug in that the parent post (where POST_IS_TOPIC=1) isn't gauranteed to display first in Flat Mode.