Skip to content

Error when deprecating the default value of a block attribute #11705

@bfintal

Description

@bfintal

Describe the bug
Changing a custom block's default attribute value results in the error: This block contains unexpected or invalid content.

To Reproduce
Steps to reproduce the behavior:

  1. Register a custom block with an attribute that has a default value
  2. Edit a post, then add the custom block, save the post
  3. Edit the registered block and change the default value
  4. Edit the previous post. The block will have an error

Expected behavior
The previously added block shouldn't have an error. Since the block with the error was old, I expect that it shouldn't be affected with a change in an attribute's default value.

Also, removing the default value doesn't result in an error, but changing it does.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • OS: MacOS High Sierra 10.13.6
  • Browser: Chrome
  • Version: 69.0.3497.100

Additional context

  • Gutenberg v4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Block APIAPI that allows to express the block paradigm.[Package] Blocks/packages/blocks[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions