Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Compatibility:
Drupal 10.3 or later, and Drupal 11. Requires PHP 8.1+. For Drupal 11.2+ and Drupal 12, use the 2.0.x branch (2.0.0).
Upgrade:
after updating the code, run drush updatedb (or visit /update.php). See "Repair update" below.
Fixes
- Copies of inline blocks were never cleaned up. Copied blocks were saved before the layout was saved, so Drupal never tracked them. They stayed in the database after being removed from a layout, when the page was deleted, and when the layout was discarded. Copying a block that hadn't been saved yet also created an extra entity. Copies are now saved only when the layout is saved, and Drupal tracks and cleans them up like any other inline block.
- Permission fix: copying an inline block creates new block content, so it now requires the Create and edit custom blocks permission, the same one Layout Builder needs to add an inline block. Editors without it no longer see "Copy block" on inline blocks, but can still copy other blocks.
- Blocks whose content is missing are no longer copied. Before, they produced a broken block.
- Opening "Copy block" in a new tab now copies the block and returns to Layout Builder, instead of showing raw data.
- Bundle classes: copies of block content types that use bundle classes now get their own content instead of sharing it.
Repair update
A database update records the missing tracking for every inline block used by a current layout, so Drupal can clean these blocks up from now on. Blocks that aren't used by any current layout are counted and reported, never deleted.
New
hook_layout_builder_block_copy_access()lets other modules forbid copies, for example to enforce per-region block limits. See layout_builder_block_copy.api.php.- README and help page.
Behavior change:
editors who could copy inline blocks before but lack Create and edit custom blocks can no longer copy them. Grant that permission if they should keep doing so.