fix(NavigationManager): do not warn when an unknown entry is requested - #62361
Open
solracsf wants to merge 1 commit into
Open
fix(NavigationManager): do not warn when an unknown entry is requested#62361solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
get() is declared to return ?array and all of its callers handle null -
the public page layout explicitly renders an empty app list when the
current app has no navigation entry. The lookup itself did not guard
against a missing key though, so every public page rendered by an app
that registers no navigation entry (typical for files integration apps
like drawio) logged a PHP warning per page view:
Undefined array key "drawio" at lib/private/NavigationManager.php#432
Returning null explicitly keeps the behaviour identical for every
caller - the expression already evaluated to null after the warning -
and removes the log noise.
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf
requested review from
Altahrim,
come-nc,
leftybournes and
salmart-dev
and removed request for
a team
July 21, 2026 10:08
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
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.
Summary
NavigationManager::get()is declared?arrayand all of its callers handlenull:TemplateLayouteven branches on$currentAppData === nullforRENDER_AS_PUBLIC. The lookup itself does not guard against a missing key.So every public page rendered by an app that registers no navigation entry (typical for files-integration apps) logs one PHP warning per anonymous page view:
Reproduction on 33.0.6: share a file handled by such an app (e.g. drawio) as a public link, open the link in a private window. The page renders fine (the layout receives
nulland shows an empty app list), only the log noise is the problem.A unit test locks the contract (
get('unknown')returnsnull); before the fix it surfaces theUndefined array keywarning.Checklist
AI (if applicable)