Skip to content

Avoid multiple block adding while "multiple" is false in block.json #38502

Description

@ihdk

Description

Hello, I'd like to report issue, or maybe ask if there is a way to avoid duplicated blocks that have defined "multiple" parameter to false in block.json file.
Block still can be duplicated if it's for example inner block of another parent block. Issue is explained below on "Read More" block which would be inserted in post just once.
Even the "Read More" block doesn't really cause the problem if it's inserted more times, I've a block that should be inserted just once to avoid user misleading.

Thank you, Ivan.

Step-by-step reproduction instructions

  1. Open post or page to edit
  2. Insert "Group" block
  3. Insert "Read More" block inside "Group" block
  4. Duplicate "Group" block
  5. "Read more" block is available on the page two times, even it's "multiple" value is defined to false

Screenshots, screen recording, code snippet

2022-02-03_20-06-59

Environment info

  • latest Wordpress 5.9
  • tested with and without Gutenberg plugin active

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Block APIAPI that allows to express the block paradigm.[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions