Opened 7 weeks ago
Closed 7 weeks ago
#64195 closed defect (bug) (fixed)
Theme JSON: Fix filtering of default presets at block level
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 6.9 |
| Component: | Editor | Keywords: | gutenberg-merge has-patch has-unit-tests commit |
| Focuses: | Cc: |
Description
This ticket tracks the backport of PHP files for the following Gutenberg updates:
https://github.com/WordPress/gutenberg/pull/72916
These updates include a fix and additional unit tests for a bug where default presets were merged incorrectly when defaults were disabled at the block level. The bug resulted in missing presets in the settings and UI.
Further background and context is available within the original issue:
Change History (7)
This ticket was mentioned in PR #10460 on WordPress/wordpress-develop by @aaronrobertshaw.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added
#2
@
7 weeks ago
- Keywords commit added
The Gutenberg PR has been approved by two reviewers, and I believe it's ready for committing.
#3
@
7 weeks ago
@aaronrobertshaw, If you have the bandwidth, I would appreciate it if you could commit the pull request before the RC1 release next week.
#4
@
7 weeks ago
@wildworks I've only just got this notification. I can try and get this merged tomorrow morning hopefully before the RC is cut but I've only followed along on a few commits way back at the start of the year. So I'll need some help
#5
@
7 weeks ago
@aaronrobertshaw I've recently started making commits myself, so it's okay if I make the commit on your behalf. In return, I would appreciate it if you could review whether I've written the commit message correctly. Are the title and description accurate in the following commit message?
Editor: Fix handling of default presets at block level in theme.json Fix an issue where block-level presets do not work correctly when default presets are disabled and the slug matches a default preset. Props aaronrobertshaw, bph, ramonopoly, wildworks. Fixes #64195.
Trac ticket: https://core.trac.wordpress.org/ticket/64195
This PR brings the changes from the following Gutenberg PRs to core:
https://github.com/WordPress/gutenberg/pull/72916
### Description
Prevents an issue where block level presets do not work correctly when:
The result is missing presets in the settings and editor UI.
### Testing
For each theme.json example config below:
### Duotone
In the image block, only the "Dark grayscale" duotone preset should be available
{ "version": 3, "appearanceTools": true, "settings": { "blocks":{ "core/image": { "color": { "defaultDuotone": false, "duotone": [ { "name": "Dark grayscale", "colors": [ "#000000", "#7f7f7f" ], "slug": "dark-grayscale" } ] } } } } }### Shadow
In the image block, only the "Natural" shadow preset should be available
{ "version": 3, "settings": { "appearanceTools": true, "blocks":{ "core/image": { "shadow": { "defaultPresets": false, "presets": [ { "name": "Natural", "slug": "natural", "shadow": "6px 6px 9px rgba(0, 0, 0, 0.2)" } ] } } } } }### Font Size
In the Paragraph block, only the "Small" duotone preset should be available
{ "version": 3, "settings": { "appearanceTools": true, "blocks":{ "core/paragraph": { "typography": { "defaultFontSizes": false, "fontSizes": [ { "name": "Small", "slug": "small", "size": "13px" } ] } } } } }## Screenshots or screencast