Inconsistent behaviour when using group and columns block with template_lock = 'all' #17262
Description
Describe the bug
It looks to me like the columns block and group block are treated differently, when added to a block template and using template_lock = 'all'
It seems like it’s possible to add innerblocks to the columns block, but not to the group block. Strangely enough it seems possible to add inner blocks to the group block, when it itself is added inside a column.
I’m uncertain whether this is a bug or intended behaviour, but if intended it seems like inconsistent behaviour to me.
(It is also very possible, that I’m just not creating the block template in a correct manner.)
To reproduce
Steps to reproduce the behavior:
- Create a block template with both a column block and group block.
function myplugin_register_template() {
$post_type_object = get_post_type_object( 'post' );
$template = array(
array( 'core/columns', array(), array(
array( 'core/column', array(), array(
array( 'core/group', array(), array(
array( 'core/paragraph', array(
'placeholder' => 'Add a inner paragraph'
) ),
) ),
) ),
array( 'core/column', array(), array(
array( 'core/paragraph', array(
'placeholder' => 'Add a inner paragraph'
) ),
) ),
) ),
array( 'core/group', array(), array(
array( 'core/paragraph', array(
'placeholder' => 'Add a inner paragraph'
) ),
) ),
);
$post_type_object->template = $template;
$post_type_object->template_lock = 'all';
}
add_action( 'init', 'myplugin_register_template' );
- Create new post
- Successfully try to add new inner block in a column
- Unsuccessfully try to add new inner block in the group block
Expected behavior
i would expect that both group and columns block are treated like containers that has their own setting for adding inner blocks, and that they would both allow innerblocks to be added regardless of the template settings.
Desktop (please complete the following information):
- OS: MacOS
- Browser Safari
- Version 12.1.2
Additional context
- Gutenberg 6.4.0