Full Site Editing: Fix Site Title Save Bug #24302
Merged
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 #24003
Description
Users could not save updates to the Site Title block in Full Site Editing.
There were changes introduced in a previous PR #22876 that aimed to avoid dirtying un-customized templates on first load. The modifications introduced metadata to be evaluated before saving block editor updates. These included record
title
and recordstatus
as seen here.Unfortunately, Site Title also uses the
title
attribute, which, inadvertently, was being overridden by the recordtitle
.More context can be seen here in the
core/data
library.Solution
Note: I am going to lean on the expertise of others because I may be missing some context, and my solution may not be ideal.
The fix ensures that, if the record slug does not exist, then an undefined title is not included as metadata. This prevents the undefined title from overriding updates to site title.
How has this been tested?
Screenshots
Types of changes
Bug fix
Checklist: