-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Block] ImageAffects the Image BlockAffects the Image Block[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
If you set the following in your theme.json...
"settings": {
"blocks": {
"core/image": {
"lightbox": {
"enabled": false,
"allowEditing" false
}
}
}
}
...rather than persisting as false
in the in-memory representation of the theme.json
, these values are filtered out.
While functionally these values being undefined
rather than false
may result in the same behavior in most cases, this appears to be a bug and makes it difficult to achieve consistency in #54544 and #54635.
Step-by-step reproduction instructions
- In the screen-block.js file, add a console.log for
rawSettings
around line 95. - Open your web inspector and go to the Image settings in the Global Styles.
- See that the
lightbox.allowEditing: true
from the default Gutenbergtheme.json
is visible in the logged statement as expected.
- Modify your theme's
theme.json
to include the following setting to overwrite the defaultallowEditing
value:
"settings": {
"blocks": {
"core/image": {
"lightbox": {
"allowEditing" false
}
}
}
}
- Revisit the Image settings in the Global Styles, and see that the
rawSettings
no longer contains a value forlightbox
at all.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Block] ImageAffects the Image BlockAffects the Image Block[Feature] Interactivity APIAPI to add frontend interactivity to blocks.API to add frontend interactivity to blocks.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended