From 99551dba54d474e2324e2c964ba6891a7561dd4c Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Fri, 16 Dec 2022 12:44:18 +1100 Subject: [PATCH] Revert "[`customize-widgets/utils/widgetToBlock`] Initialize a widget's `raw_content.content` to an empty string if it's `undefined` (#46487)" This reverts commit 271f650c05795ab81cc73b2617ba53485ac57de9. --- packages/customize-widgets/src/utils.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/customize-widgets/src/utils.js b/packages/customize-widgets/src/utils.js index 8cf2d5990423ca..f2f254b5ae6af6 100644 --- a/packages/customize-widgets/src/utils.js +++ b/packages/customize-widgets/src/utils.js @@ -98,14 +98,10 @@ export function widgetToBlock( { id, idBase, number, instance } ) { const { encoded_serialized_instance: encoded, instance_hash_key: hash, - raw_instance: rawInstance, + raw_instance: raw, ...rest } = instance; - // It's unclear why `content` is sometimes `undefined`, but it shouldn't be. - const rawContent = rawInstance.content || ''; - const raw = { ...rawInstance, content: rawContent }; - if ( idBase === 'block' ) { const parsedBlocks = parse( raw.content, { __unstableSkipAutop: true,