-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gutenberg crash if custom post type has template lock #37912
Comments
Hello, @Tropicalista How are you inserting the pattern? The Am I missing any details? Screenshot |
I have probably messed up something. I was testing the 5.9 release candidate. Once the custom post type is created, the button is disabled. But if I try to insert a child block the pattern is enabled and should work. This was working great on 5.8.3. You can test it using my plugin: https://wordpress.org/plugins/popper/ |
I have confirmed that this issue occurs not only with custom post types. If I think blocks should not be able to be inserted at either level of hierarchy Testing Instruction
function custom_registered_post_type_post( $post_type, $post_type_object ) {
$post_type_object->template = array(
array( 'core/paragraph' )
);
$post_type_object->template_lock = 'insert';
}
add_action( 'registered_post_type_post', 'custom_registered_post_type_post', 10, 2 );
95a52899d702f54688531442ccb9b5dc.mp4Error Info
|
Description
I create a custom post type with template lock. All works great, but if I select patterns on block inserter Gutenberg crashes.
I think the problem is template lock, because disabling it, all works great.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
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: