Skip to content

Commit 7043eaa

Browse files
authored
Include missing attributes when upgrading embed block (#33235)
* Include missing attributes in upgraded embed block * Update block-library changelog * Use rest of attributes when upgrading embed block
1 parent a6908dc commit 7043eaa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/block-library/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- Removes the `core/legacy-widget` block. This is now in `@wordpress/widgets`
88
via `registerLegacyWidgetBlock()`.
99

10+
## Bug Fixes
11+
12+
- Include missing attributes when upgrading embed block ([#33235](https://github.com/WordPress/gutenberg/pull/33235))
13+
1014
## 3.2.0 (2021-05-24)
1115

1216
### New Features

packages/block-library/src/embed/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ export const createUpgradedEmbedBlock = (
9595
props,
9696
attributesFromPreview = {}
9797
) => {
98-
const { preview, attributes: { url, providerNameSlug, type } = {} } = props;
98+
const { preview, attributes = {} } = props;
99+
const { url, providerNameSlug, type, ...restAttributes } = attributes;
99100

100101
if ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;
101102

@@ -115,6 +116,7 @@ export const createUpgradedEmbedBlock = (
115116
if ( shouldCreateNewBlock ) {
116117
return createBlock( DEFAULT_EMBED_BLOCK, {
117118
url,
119+
...restAttributes,
118120
...matchedBlock.attributes,
119121
} );
120122
}

0 commit comments

Comments
 (0)