Skip to content

[6.x] Fix CP nav breaking when a form has no title - #15144

Merged
jasonvarga merged 2 commits into
6.xfrom
nav-null-bugs
Aug 9, 2026
Merged

[6.x] Fix CP nav breaking when a form has no title#15144
jasonvarga merged 2 commits into
6.xfrom
nav-null-bugs

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

Fixes two independent bugs that could take down the entire Control Panel nav.

Nav::create() returned null when given a null display name

NavItem::display() is a fluent get-or-set, so passing null means "get". Chaining create() 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, CoreNav died with Call 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.

jasonvarga and others added 2 commits August 8, 2026 10:03
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>
@jasonvarga
jasonvarga merged commit 87dbc58 into 6.x Aug 9, 2026
23 checks passed
@jasonvarga
jasonvarga deleted the nav-null-bugs branch August 9, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant