Cover Blocks with legacy markup lose their content after block recovery if hasParallax was true #51473
Labels
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
[Feature] Block Validation/Deprecation
Handling block validation to determine accuracy and deprecation
Description
The Cover Block used to use an inline style attribute on the main div for the background image but now uses a nested img tag for regular backgrounds or nested div tag for fixed backgrounds. The new markup means any content saved by a previous version of WordPress will fail block validation when the editor loads. "Attempt Block Recovery" should fix the block but if hasParallex was true in the legacy markup the recovery process removes all the previously nested content / blocks.
Step-by-step reproduction instructions
Workaround
Removing the
"hasParallax":true
block attribute from the comment fixes the issue. The block will still fail validation but recovering the block will work and any nested content will be retained.Legacy Cover Block markup for testing
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: