Open skorasaurus opened 3 years ago
I can confirm the editor crashing if core patterns are unregistered. The pull request https://github.com/justintadlock/block-pattern-builder/pull/17 appears to fix this issue (tested just now) but it's not yet merged and it has some minor issues still.
Very interested in getting this fix in place.
Hi,
When a user unregisters the core-block-patterns that ship with gutenberg/block editor, (this can be done by
remove_theme_support( 'core-block-patterns' );
within aninit
orafter_theme_setup
hook) (ref: https://fullsiteediting.com/lessons/block-patterns-tips/), the block editor will crash if you have any block patterns made with the block-pattern-builder.I've reproduced this in Gutenberg 9.4.1 and in a copy that I built a few minutes ago from the master branch of the gutenberg repo.
I'm pretty sure this is a result of a lack of categories support in the block-pattern-builder; I'm not able to reproduce this when I delete the bpb_pattern from my posts list.
To reproduce:
Editor crashes
console:
Uncaught TypeError: t.categories is undefined s https://local.wordpress.test/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:30 s https://local.wordpress.test/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:30 s https://local.wordpress.test/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:30 mountMemo https://local.wordpress.test/wp-content/plugins/gutenberg/vendor/react-dom.82e849f1.js:15577 useMemo https://local.wordpress.test/wp-content/plugins/gutenberg/vendor/react-dom.82e849f1.js:15873 useMemo https://local.wordpress.test/wp-content/plugins/gutenberg/vendor/react.af754d50.js:1607 is https://local.wordpress.test/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=fdb8c27842d6665c8f717ab07efd9458:30 renderWithHooks https://local.wordpress.test/wp-content/plugins/gutenberg/vendor/react-dom.82e849f1.js:14938