[6.x] Fix CP nav breaking when a form has no title - #15144
Merged
Conversation
NavItem::display() is a fluent get-or-set, so passing null meant "get". Chaining create() off it returned the current display (null) instead of the item, and pushed that null into the registered items. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches collections, taxonomies, asset containers, globals, roles, and user groups, which all humanize the handle when no title is set. Without it, a title-less form gave a null nav item display and broke the CP nav. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 10, 2026
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.
Fixes two independent bugs that could take down the entire Control Panel nav.
Nav::create()returned null when given a null display nameNavItem::display()is a fluent get-or-set, so passing null means "get". Chainingcreate()off it returned the current display (null) rather than the item, and pushed that null into the registered items — corrupting the list for everything downstream.Nav::item()is an alias, so it had the same problem.The item is now constructed and
display()called as a statement, so the item is always returned.display()'s fluent get-or-set semantics are unchanged.A form with no title crashed the nav
Form::title()was the only titled entity without a fallback, so a form whose YAML has no title returned null. Combined with the above,CoreNavdied withCall to a member function url() on null— one malformed form took out the whole nav.Form::title()now falls back to the humanized handle, matching collections, taxonomies, asset containers, globals, roles, and user groups.save()writes the raw property, so the fallback is never persisted to YAML.