Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ihdk opened this issue Feb 3, 2022 · 0 comments · Fixed by #57576
Closed

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

ihdk opened this issue Feb 3, 2022 · 0 comments · Fixed by #57576
Labels
[Feature] Block API API that allows to express the block paradigm. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@ihdk
Copy link

ihdk commented Feb 3, 2022

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

@gziolo gziolo added [Feature] Block API API that allows to express the block paradigm. [Type] Bug An existing feature does not function as intended labels Feb 11, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Mar 28, 2022
delowardev added a commit to delowardev/gutenberg that referenced this issue May 6, 2022
fai-sal pushed a commit to fai-sal/gutenberg that referenced this issue Jan 5, 2024
getdave added a commit that referenced this issue Feb 9, 2024
…57576)

* Multiple use block validation logic improvement

See: #38502

* Added playwright as the testing library

* Moved 'validate-multiple-use' test to 'test/e2e/specs/editor/variou' dir

* renamed test file

* Fix: issues with block insertion for testing

* Rewrite test cases by playwright role api

* Fix iframe locator issue

* Update playwright locators by 'getByRole'

* Using 'clickBlockOptionsMenuItem' function

* Apply comment wording improvements

Co-authored-by: Ben Dwyer <ben@scruffian.com>

---------

Co-authored-by: Delowar Hossain <delowardev@gmail.com>
Co-authored-by: Dave Smith <getdavemail@gmail.com>
Co-authored-by: Ben Dwyer <ben@scruffian.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
2 participants