Repository navigation
Count "show all pages" topics after the forum list is built - #206
Merged
Merged
Conversation
With rt_page_number on, display_recent_topics() ran the topic count that sets total_topics_limit before get_forum_list(). forum_ids was still null, so get_forums_visibility_sql() reduced the count to forums where the user has m_approve: 0 for most users, and a count of only their moderated forums for a moderator, which then truncated the list and broke the pagination. Run the count after get_forum_list() and its empty-list return. The sort order is set before both, as get_allowed_topics_sql() reads it. Closes #195 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Closes #195.
Problem
With "Show all recent topic pages" (
rt_page_number) on,display_recent_topics()ran the count that setstotal_topics_limitbeforeget_forum_list().$this->forum_idswas stillnull, soget_forums_visibility_sql()reduced the count to forums where the user hasm_approve. That gave 0 for most users. For a moderator it gave a count of only their moderated forums, which then truncated the list and broke the pagination.Fix
core/recenttopics.php: the count now runs afterget_forum_list()and its "no forums" early return. The sort-order setup moved up withget_forum_list(), sinceget_allowed_topics_sql()reads it. Nothing else changed.Tests
tests/core/topic_count_test.php, documented intests/tests.md. It runsdisplay_recent_topics()with "show all pages" on and checks that every topic query is scoped to the user's forum list. Before the fix the count query received an empty list (failed); after, it passes.Checked on the local board (boot script,
rt_page_numberswitched on in memory only):No changelog entry or version bump, per this repo's convention.
🤖 Generated with Claude Code