Skip to content

Commit c357957

Browse files
getdaveyouknowriad
authored andcommitted
Widget screens: set html block as freeform content handler (#33164)
1 parent d1c0103 commit c357957

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/customize-widgets/src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
registerLegacyWidgetBlock,
1212
registerLegacyWidgetVariations,
1313
} from '@wordpress/widgets';
14+
import { setFreeformContentHandlerName } from '@wordpress/blocks';
1415

1516
/**
1617
* Internal dependencies
@@ -49,6 +50,12 @@ export function initialize( editorName, blockEditorSettings ) {
4950
}
5051
registerLegacyWidgetVariations( blockEditorSettings );
5152

53+
// As we are unregistering `core/freeform` to avoid the Classic block, we must
54+
// replace it with something as the default freeform content handler. Failure to
55+
// do this will result in errors in the default block parser.
56+
// see: https://github.com/WordPress/gutenberg/issues/33097
57+
setFreeformContentHandlerName( 'core/html' );
58+
5259
const SidebarControl = getSidebarControl( blockEditorSettings );
5360

5461
wp.customize.sectionConstructor.sidebar = getSidebarSection();

packages/edit-widgets/src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import {
55
registerBlockType,
66
unstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase
7+
setFreeformContentHandlerName,
78
} from '@wordpress/blocks';
89
import { render } from '@wordpress/element';
910
import {
@@ -63,6 +64,11 @@ export function initialize( id, settings ) {
6364
settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>
6465
fetchLinkSuggestions( search, searchOptions, settings );
6566

67+
// As we are unregistering `core/freeform` to avoid the Classic block, we must
68+
// replace it with something as the default freeform content handler. Failure to
69+
// do this will result in errors in the default block parser.
70+
// see: https://github.com/WordPress/gutenberg/issues/33097
71+
setFreeformContentHandlerName( 'core/html' );
6672
render(
6773
<Layout blockEditorSettings={ settings } />,
6874
document.getElementById( id )

0 commit comments

Comments
 (0)