Problem

When for any reason, one or more empty reusable Gutenberg blocks exist on the Drupal installation, this breaks the editor when trying to add a new block to any content type.

Replication

  • Create a reusable block
  • Go to /admin/structure/block/block-content and click edit on your reusable block
  • Delete the content field of that block
  • Go back to editing a page with Gutenberg and try to insert any block

Suggested solution

A: Provide a valid error message about a reusable block has no content, with a link to edit it (or simply delete it?)
B: Ignore the block in the Gutenberg blocks selector?
C: Rewrite the current error message to inform about this case?
D: Make the block be used (might be content on the site relying on the block, that simply needs new content). When used we could show the same message as when the full block has been deleted:

Remaining tasks

Decide a UX pattern that that makes sense
Build out content / help texts for the handling.
Implement the improvement

Comments

jhhansen created an issue. See original summary.

thorandre’s picture

Issue summary: View changes
StatusFileSize
new12.04 KB

I was able to recreate the issue. This could happen for example if a block is deleted in the Drupal custom blocks UI.

jhhansen’s picture

Great replication, thank you :)

I'm leaning towards supporting your suggestion D.

shane birley’s picture

shane birley’s picture

henrikakselsen’s picture

Could not recreate this on 2.x branch