Export block UUID with custom Layout Builder blocks

Created on 4 November 2020, about 4 years ago
Updated 5 August 2024, 5 months ago

Problem/Motivation

Currently, if you create custom blocks inside a Layout Builder default layout, those blocks are exported with their revision_id as the key. This can lead to errors when syncing config across environments -- even when those blocks are auto-created via migration or some other method.

Steps to reproduce

  1. Create a new node type on dev/staging environment
  2. Enable layout builder for this bundle (no override layouts)
  3. Create a default layout with inline blocks
  4. drush config:export, transfer config to live environment, drush config:import
  5. visit /admin/structure/types/manage/NODE_TYPE/display/default/layout
  6. WSOD due missing inline blocks, even without overridden layouts

This issue can be mitigated by 🐛 PHP message: Error: Call to a member function getEntityTypeId() on null (Layout Builder) Needs work and by exporting blocks with Default Content 📌 [PP-1] Expose Layout Builder data to REST and JSON:API Postponed . However, we cannot guarantee that the revision_id will match when the blocks are exported/imported.

Proposed resolution

Export the 'block_uuid' as part of the configuration, and use it for block loading if it is present.

Remaining tasks

- Needs a patch that is 9.2.x compatible
- Needs tests

User interface changes

- None

API changes

- None

Data model changes

- Adds "block_uuid" to the Layout Builder schema.

Release notes snippet

Feature request
Status

Needs work

Version

11.0 🔥

Component
Layout builder 

Last updated 1 day ago

Created by

🇺🇸United States agentrickard Georgia (US)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

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