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

Validation for UseOnce blocks when switching from code to visual #4932

Closed
hedgefield opened this issue Feb 7, 2018 · 1 comment
Closed
Assignees
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.

Comments

@hedgefield
Copy link

hedgefield commented Feb 7, 2018

Issue Overview

I can add multiple instances of a UseOnce block to a post by copy-pasting in the code editor. They don't get removed when switching back to the visual editor (or when publishing the post).

Steps to Reproduce (for bugs)

  1. Start a post
  2. Switch to the code editor
  3. Add a Read More block via the inserter (after this it won't allow me to add a 2nd one this way, so that's good)
  4. Copy-paste the block tag several times
  5. Switch to the visual editor and see multiple Read More blocks with no warnings or notices

Gutenberg 2.1 + WP 4.9.4

Expected Behavior

To run validation when switching back from the code editor to remove the extra blocks, or show some sort of notice.

Pinging @mcsf as we discussed this during the core-editor chat.

@mtias mtias added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks labels Feb 7, 2018
@mcsf
Copy link
Contributor

mcsf commented Feb 13, 2018

@hedgefield, have a look at #5031, let me know what you think.

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. [Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants