Block type unexpectedly not registered when icon is '' or null in WordPress 5.3 #18894
Labels
Backwards Compatibility
Issues or PRs that impact backwards compatability
[Feature] Block API
API that allows to express the block paradigm.
[Status] In Progress
Tracking issues with work in progress
Before WordPress 5.3, it was possible to register a block type using an empty string or null value for
icon
. This would result in the block type using the default 'block' icon.In WordPress 5.3, a block type registered with
icon: ''
oricon: null
will trigger this warning:The early return statement added in 1a7255f#diff-bcd12caf7289c956a519c4cd8f3f363eR144-R150 causes the block type to not be registered.
My expectation is that a block type with
icon: ''
oricon: null
would be registered with a default icon.I took a look at the history of
normalizeIconObject
(https://github.com/WordPress/gutenberg/blame/a71241ca616642f6f590d6982fd82b46d96158ac/packages/blocks/src/api/utils.js#L85-L106). It seems like the last changes are a year old, so I'm not sure why we're only now experiencing this issue?The text was updated successfully, but these errors were encountered: