diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index 62ed002f5d028..21549ecbb8936 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -7,6 +7,10 @@ - Removes the `core/legacy-widget` block. This is now in `@wordpress/widgets` via `registerLegacyWidgetBlock()`. +## Bug Fixes + +- Include missing attributes when upgrading embed block ([#33235](https://github.com/WordPress/gutenberg/pull/33235)) + ## 3.2.0 (2021-05-24) ### New Features diff --git a/packages/block-library/src/embed/util.js b/packages/block-library/src/embed/util.js index 49e98b015ba9e..960e294856f8b 100644 --- a/packages/block-library/src/embed/util.js +++ b/packages/block-library/src/embed/util.js @@ -95,7 +95,8 @@ export const createUpgradedEmbedBlock = ( props, attributesFromPreview = {} ) => { - const { preview, attributes: { url, providerNameSlug, type } = {} } = props; + const { preview, attributes = {} } = props; + const { url, providerNameSlug, type, ...restAttributes } = attributes; if ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return; @@ -115,6 +116,7 @@ export const createUpgradedEmbedBlock = ( if ( shouldCreateNewBlock ) { return createBlock( DEFAULT_EMBED_BLOCK, { url, + ...restAttributes, ...matchedBlock.attributes, } ); }