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

Add warning for missing blocks #8246

Closed
wants to merge 1 commit into from

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Jul 27, 2018

Description

This PR adds a dedicated fallback block to handle the cases where a block in our content no longer exists.

Fixes #7811.

How has this been tested?

Manually tested using local custom blocks, deactivating and reactivating the plugin. I observed the missing blocks fallback when the custom block plugin was deactivated, and I observed the original block type once I reactivated the plugin.

The plan is to add automated tests as well.

Screenshots

missing-blocks-ui

Types of changes

  • Adds a core/unknown block to use instead of core/freeform for fallback.
  • The parser now saves the original block name and attributes when a block is missing and is loaded by the fallback block instead.
  • When the fallback block supports preserveOriginalContent, the serializer preserves its original content.

Remaining

  • Get copy reviewed and corrected.
  • Write unit tests.
  • Update or fixes for existing tests .
  • Determine how to preserve nested content or defer until after the Try Gutenberg release.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@brandonpayton brandonpayton added [Status] In Progress Tracking issues with work in progress [Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks [Feature] Block Transforms Block transforms from one block to another labels Jul 27, 2018
@brandonpayton
Copy link
Member Author

🚨 This PR is broken. I thought the fallback block was simply for unknown blocks, but it is for "classic" content as well, which means this PR currently treats classic content as an unknown block.

Time to review this and determine next steps.

@brandonpayton brandonpayton removed the [Status] In Progress Tracking issues with work in progress label Aug 27, 2018
@brandonpayton brandonpayton deleted the add/ui-for-missing-blocks branch August 27, 2018 22:31
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] Block Transforms Block transforms from one block to another [Feature] Blocks Overall functionality of blocks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Special Invalid Case for Missing Blocks
1 participant