Fix: Content block disappears from List View when changing page slug with "Show template" enabled #74888
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.
What?
Fixes #74884
The Content block disappearing from List View when changing a page's URL slug while "Show template" is enabled on block themes.
Why?
When editing a page with "Show template" enabled and changing the URL slug:
Root Cause:
The
getTemplateId()selector in core-data uses the page slug to determine which template to display. When the slug changed, the selector would:page-new-slug)undefinedHow?
Modified
getTemplateId()inpackages/core-data/src/private-selectors.tsto implement proper fallback logic:Before: Attempted to find slug-specific template in a single call, which could return undefined
After: Two-step approach:
page-about,single-post-hello-world)page,single-post)This ensures the function always returns a valid template ID, preventing undefined states that cause the Content block to disappear.
Testing Instructions
Screenshots or screencast
Before:
Screen.Recording.2026-01-23.at.5.09.45.PM.mov
After:
Screen.Recording.2026-01-23.at.5.12.08.PM.mov