Allow users to create a block content entity with a specific UUID if it is a missing dependency of a config object

Created on 5 September 2017, over 7 years ago
Updated 4 December 2023, over 1 year ago

Custom blocks cannot be properly exported and imported Active is pretty nasty in terms of UX but apparently hard to fix.

Basically, if you export a custom block configuration and import this configuration in a new website you will have a "This block is broken or missing" error has the content is effectively missing.

But we perhaps give the user a chance to save is website by replacing:

"This block is broken or missing. You may be missing content or you might need to enable the original module."
by
"'The content of the block (%bundle %uuid) is missing. Add missing content.'.

Proposed resolution

  • Listen to missing content event in block content module.
  • Take note of missing block content UUIDs
  • Store them in state.
  • In the derivative discovery, make definitions available for those UUIDs
  • In the build method for these, output a link with a prebuilt uuid and type (taken from the missing content event stuff that is saved in state)
  • This link will create a stub entity of that type and with that uuid and then present the edit form
  • User submits, hey presto its fixed
  • State entry is cleaned up when block is saved
  • Tests cover that scenario

Remaining tasks

Approach as per comment 37

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Block content 

Last updated about 3 hours ago

Created by

🇨🇭Switzerland gagarine

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024