[3.0] Count the posts a board is holding for approval - #9400
Merged
live627 merged 1 commit intoAug 11, 2026
Merged
Conversation
there_are_unapproved_topics puts both counts through ICU plural arguments, and the string carries its own link to the moderation queue. The two counts were being wrapped in links of their own before being handed over, so ICU saw a string where it wanted a number, read it as zero, and dropped the markup. Every board with something waiting therefore said "There are 0 topics and 0 posts awaiting approval in this board", whatever it was actually holding. With three unapproved topics and five unapproved posts it now says three topics and two posts, the two being the replies. Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
Closed
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
A board with posts waiting for approval always said it had none:
$txt['there_are_unapproved_topics']puts both counts through ICU plural arguments, and carries its own link to the moderation queue:MessageIndex::buildUnapprovedPostsMessage()wrapped each count in a link of its own before handing it over. ICU wants a number for a plural argument, gets a string, reads it as zero, and drops the markup on the floor — so the counts read zero and the extra links never appeared anyway.Straight off the running forum, on a board carrying three unapproved topics and five unapproved posts:
Three topics and two posts, the two being the replies —
unapproved_postscounts the topic starters as well, which is why the existing code subtracts.Reduced to the pattern on its own, so the coercion is easy to see:
The
urlargument is already built for whichever queue is the more useful one, so nothing is lost by letting the string place the single link itself.This is one of the fixes carried on the #7933 branch. It touches no theme template, so per the grouping asked for on that PR it comes over on its own, straight to
release-3.0.Issues References (Fixes|Related|Closes)
Related to #7933