diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md
index c048be58f54617..535fbfc874358b 100644
--- a/packages/block-library/CHANGELOG.md
+++ b/packages/block-library/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### Bug Fixes
+
+- Fix a regression where the Cover block migration would not work with a non-default contentPosition ([#29542](https://github.com/WordPress/gutenberg/pull/29542))
+
## 2.28.0 (2021-02-01)
### New Features
diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js
index d3f1588944c1b9..64b80bd1925959 100644
--- a/packages/block-library/src/cover/deprecated.js
+++ b/packages/block-library/src/cover/deprecated.js
@@ -88,6 +88,9 @@ const deprecated = [
customGradient: {
type: 'string',
},
+ contentPosition: {
+ type: 'string',
+ },
},
supports: {
align: true,
diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html
index 79f8a553b77af0..3d36466465768a 100644
--- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html
+++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html
@@ -24,3 +24,12 @@
+
+
+
+
+
diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json
index 08423dc54bfb97..81162a5eec7d23 100644
--- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json
+++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json
@@ -65,5 +65,36 @@
}
],
"originalContent": ""
+ },
+ {
+ "clientId": "_clientId_2",
+ "name": "core/cover",
+ "isValid": true,
+ "attributes": {
+ "url": "http://localhost:8888/wp-content/uploads/2021/02/percy.jpg",
+ "id": 134,
+ "hasParallax": false,
+ "isRepeated": false,
+ "dimRatio": 50,
+ "backgroundType": "image",
+ "contentPosition": "bottom right"
+ },
+ "innerBlocks": [
+ {
+ "clientId": "_clientId_0",
+ "name": "core/paragraph",
+ "isValid": true,
+ "attributes": {
+ "align": "center",
+ "content": "test",
+ "dropCap": false,
+ "placeholder": "Write title…",
+ "fontSize": "large"
+ },
+ "innerBlocks": [],
+ "originalContent": "test
"
+ }
+ ],
+ "originalContent": "\n\t
\n\t\t\n\t
\n
"
}
]
diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json
index cb1f14786bf34e..1b34cdbb1c6617 100644
--- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json
+++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json
@@ -68,6 +68,44 @@
"\n\t\n\n"
]
},
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n",
+ "innerContent": [
+ "\n"
+ ]
+ },
+ {
+ "blockName": "core/cover",
+ "attrs": {
+ "url": "http://localhost:8888/wp-content/uploads/2021/02/percy.jpg",
+ "id": 134,
+ "contentPosition": "bottom right"
+ },
+ "innerBlocks": [
+ {
+ "blockName": "core/paragraph",
+ "attrs": {
+ "align": "center",
+ "placeholder": "Write title…",
+ "fontSize": "large"
+ },
+ "innerBlocks": [],
+ "innerHTML": "\n\t\ttest
\n\t\t",
+ "innerContent": [
+ "\n\t\ttest
\n\t\t"
+ ]
+ }
+ ],
+ "innerHTML": "\n\n\t
\n\t\t\n\t
\n
\n",
+ "innerContent": [
+ "\n\n\t
\n\t\t",
+ null,
+ "\n\t
\n
\n"
+ ]
+ },
{
"blockName": null,
"attrs": {},
diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html
index e2b0d685154624..8042707c25e569 100644
--- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html
+++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html
@@ -11,3 +11,9 @@
+
+
+
+