Skip to content

Commit

Permalink
Revert "[customize-widgets/utils/widgetToBlock] Initialize a widget…
Browse files Browse the repository at this point in the history
…'s `raw_content.content` to an empty string if it's `undefined` (#46487)"

This reverts commit 271f650.
  • Loading branch information
noisysocks committed Dec 20, 2022
1 parent 0d5caa2 commit 99551db
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/customize-widgets/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 99551db

Please sign in to comment.