Repository navigation
[2.1] Lists the posts to split off a topic in a defined order - #9758
Merged
jdarwood007 merged 1 commit intoOct 31, 2026
Merged
jdarwood007 merged 1 commit into
jdarwood007 merged 1 commit into
Conversation
The four queries behind the split page only ordered by message id for members who view topics newest first. Otherwise the order was the database's, which on PostgreSQL puts an edited post last, and with LIMIT decides which posts land on which page. Backport of SimpleMachines#9714. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #9714.
The page for choosing which posts to split off a topic lists them in no defined order on PostgreSQL. All four queries in
SplitSelectTopics()(the selected and not-selected lists, each in the page and in its xml refresh) only addedORDER BYfor members who view topics newest first:Otherwise the order was up to the database. MySQL happens to return InnoDB rows in primary key order. PostgreSQL returns them in the order they are stored, and an
UPDATEwrites the row's new version at the end, so an edited post is listed after the posts that came after it. The same queries useLIMIT, so the order also decides which posts land on which page: a post can appear on two pages and be missing from another.They now always order by message id, descending for members who view newest first:
Testing
Checked on a freshly installed
release-2.1forum on PostgreSQL 17, with a topic of three posts (4, 5, 6) whose first post was then edited in the database:MySQL showed the right order before and after, as expected. Nothing in
log_errors.Issues References (Fixes|Related|Closes)
Related: #9753, #9714
🤖 Generated with Claude Code