[3.0] Stop drawing an empty tab menu with an unresolved label - #9407
Open
albertlast wants to merge 1 commit into
Open
[3.0] Stop drawing an empty tab menu with an unresolved label#9407albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
Admin and moderation pages whose menu has no title of its own drew a mobile
tab menu containing nothing, labelled with the literal text "{label} Menu".
The block is guarded on Utils::$context['tabs'] but draws
$tab_context['tabs']. Those are not the same list.
Utils::$context['tabs'] is set as a side effect of drawing the menu itself,
from the selected area's subsections, while $tab_context['tabs'] is only
assembled from it inside the "does this menu have a title" branch above. On a
page with subsections but no tab title - Scheduled Tasks, for one - the first
is full and the second was never built, so the guard passed and the loop had
nothing to iterate.
The label came out raw for the same reason: $tab_context['title'] was never
set, and Localization\MessageFormatter drops non-scalar arguments before
formatting, so a null one leaves its placeholder in the output rather than
resolving to an empty string.
The guard now names the list that gets drawn, and the label falls back to an
empty string. Pages that do have tabs are untouched: Manage Members, Features
and Options and Reported Members all still get their menus.
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
Admin and moderation pages whose menu has no title of its own drew a mobile tab menu containing nothing, labelled with the literal text
{label} Menu. Straight off Admin → Scheduled Tasks:Two lists with the same name
The block is guarded on
Utils::$context['tabs']but draws$tab_context['tabs']:They are not the same list.
Utils::$context['tabs']is set as a side effect of drawing the menu itself, from whichever area is selected:$tab_context['tabs']is only assembled from it inside theif (!empty($tab_context['title']))branch further up. So on a page that has subsections but no tab title, the first is full and the second was never built — the guard passes, the loop finds nothing.And why the label stayed raw
$tab_context['title']was never set either, so the call passes['label' => null].Localization\MessageFormatter::formatMessage()filters its arguments before handing them over:is_scalar(null)is false, so the argument is dropped, and ICU leaves an unmatched placeholder in the output rather than substituting an empty string. Reproduced directly —['label' => null]through intl gives" Menu", but with the argument filtered out it gives"{label} Menu".The guard now names the list that actually gets drawn, and the label falls back to
''so the same thing cannot happen if a menu ever gets tabs without a title.Checked
Four pages on the running forum.
{label}no longer appears anywhere, Scheduled Tasks draws no#adm_submenusat all, and the pages that do have tabs are untouched:Found by sweeping every rendered page of a stock forum for unsubstituted
{placeholders}. This is one of the three the sweep turned up.GenericMenu.template.phpis also touched by #9392, which makes this element anavlandmark; the two do not overlap.Issues References (Fixes|Related|Closes)
Related to #7933