Block variations registered on the server can get overwritten in the client #60298
Labels
[Feature] Block Variations
Block variations, including introducing new variations and variations as a feature
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
As reported in https://core.trac.wordpress.org/ticket/60856, the
core/group
block does not register any of its variations on the server, but instead adds them at runtime in the client. This means that any variations registered on the server via filters or other means get overwritten when thecore/group
block is initialized. I suspect this behavior is consistent with all blocks that are adding variations, which likely includes this whole list.I would expect that any variations supplied by the server would be added to the variations added to the block in JS.
Step-by-step reproduction instructions
get_block_type_variations
filter in PHP.get_block_editor_server_block_settings()
, which is used to bootstrap block types from the server.wp.blocks.getBlockTypes().filter( (block) => block.name === 'core/group' )
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
The text was updated successfully, but these errors were encountered: