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

Create new blocks as valid #2033

Merged
merged 2 commits into from
Jul 26, 2017
Merged

Create new blocks as valid #2033

merged 2 commits into from
Jul 26, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Jul 26, 2017

Regression introduced in #1929

This pull request seeks to resolve a bug where creating a new block will flag it as corrupt, presenting the user with a warning.

The issue is that we check ! block.isValid as considering a block to be corrupt, and this property was not assigned to newly created blocks.

We may want to refactor this behavior to explicitly check either false === block.isValid or block.isInvalid instead, but this change addresses the immediate breakage.

Testing instructions:

  1. Navigate to Gutenberg > New Post
  2. Click Write
  3. Note you are not presented with corrupt warning

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Jul 26, 2017
@aduth aduth requested a review from nylen July 26, 2017 17:22
Copy link
Member

@nylen nylen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFM 👍

A new block should be valid, and isValid can be thought of as a required attribute like uid and name. I don't see a problem with this fix.

@aduth aduth merged commit 073cfc4 into master Jul 26, 2017
@aduth aduth deleted the fix/new-block-invalid branch July 26, 2017 17:36
@aduth
Copy link
Member Author

aduth commented Jul 26, 2017

(Publicly shames self for neglecting to squash & merge)

@aduth
Copy link
Member Author

aduth commented Jul 26, 2017

I think I needed to have regenerated the .json block fixtures, as the ordering of isValid changed.

Tug pushed a commit that referenced this pull request Mar 19, 2020
* update ref to master (fix gallery caption)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants