Install

Works with Drupal: ^10.3 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 24.77 KB
MD5: 308ea810880672c51d380e8ece91d6cb
SHA-1: 4a8d9212c29311ee71a770d61f68608e6fb57ea6
SHA-256: cd5087f850f09d6c83b4154d2ec9c3e03288aab60db63dad6b91c0293305126a
Download zip 35.74 KB
MD5: 3bec3ac52c7f08c8edecef621814a7f0
SHA-1: b5502d950c8c221313388d9778cf0ec29edd0648
SHA-256: 4fbfc5a5413de65c79e5f0ee79596204ca79030674bfb47b6d0b917d17c84fdb

Release notes

Layout Builder Block Copy 1.1.0 is a bug-fix and maintenance release for Drupal 10.3+ and Drupal 11 (PHP 8.1+). Sites on Drupal 11.2 or later, including Drupal 12, should use the 2.0.x branch.

This is a minor release, not a patch, because copying in code changed in 1.0.9. See API changes below.

Upgrading

  • Run database updates (drush updatedb). This records missing usage for inline blocks copied by releases before 1.0.9, so Drupal can delete them when they are removed. It is skipped if it already ran with 1.0.9.
  • To repair and check inline block usage at any time, run drush layout_builder_block_copy:repair-usage --dry-run. See New below.

Bug fixes

  • Copying an unsaved block whose fields hold other entities, such as paragraphs, failed with an HTTP 500 error (Cannot use object of type __PHP_Incomplete_Class as array).
  • On Drupal 10.3 to 11.0, a copy shared its paragraphs with the original, so editing one changed both. Copies now get their own paragraphs, and other composite entities referenced through Entity Reference Revisions, on every supported Drupal version.
  • Copy links were checked against the saved layout instead of the unsaved one. Users without the Create and edit custom blocks permission could see Copy links that answered "Access denied", and blocks added since the last save were judged wrongly.
  • Copies placed in an entity that did not exist yet, for example when cloning in code, had usage records without an owner. Their blocks were never cleaned up, were hidden from visitors, and on Drupal 10.3 with assertions enabled, the Layout Builder failed with an error. The new entity now owns them once it is saved.
  • Layout Builder Lock was ignored. Blocks can no longer be copied into a section locked against adding blocks, or into a locked region (Layout Builder Lock 2.x), unless the user has the lock module's bypass permission.
  • PHP errors during a copy ended in an HTTP 500 error with nothing logged. They are now logged, and the user sees a message.
  • Placements of content blocks that were deleted, or are no longer reusable, were copied into another broken placement. They are now refused with the message "This block is broken or its content is missing, so it cannot be copied."
  • After installing the module, the Copy link only appeared after a full cache rebuild.

New

  • Drush command layout_builder_block_copy:repair-usage (alias lbbc-repair). It records missing inline block usage, then reads every revision of every layout, the default layouts and unsaved layouts, and reports:
    • usage records that name an entity type but no entity;
    • blocks recorded as used by a layout that does not use them, while other layouts do;
    • non-reusable blocks that no layout uses in any revision.

    --dry-run changes nothing. --delete-unreferenced deletes the unused blocks after a confirmation. Take a database backup first.

  • BlockCopyManagerInterface, also available as a service under its interface name.
  • The Copy link is kept when other modules change Layout Builder's contextual link operations.

API changes (since 1.0.8)

  • deepCloneComponent() returns an unsaved copy. The duplicated inline block is serialized into the component and saved by core with the layout. block_id and block_revision_id are NULL until then.
  • deepCloneComponent() throws BlockCopyException when the copy would be a broken block.
  • claimNewEntityUsage($entity) assigns ownerless usage to a newly saved entity. It is only needed by code that saves layouts without entity hooks.
  • cleanupOrphanedComponent() is deprecated and removed in 2.0.0. Copies are no longer saved before the layout, so there is nothing to clean up.

Requirements

  • Drupal 10.3 or later, or Drupal 11. Layout Builder and Block Content.
  • PHP 8.1 or later; PHP 8.3 or later is recommended.

Changes since 1.0.9

  • Show the Copy link right after install, without a cache rebuild.
  • Fix copying with nested entities, paragraphs on Drupal 10, access and usage; add the repair-usage command.
  • Fix CI: translation test under a sub-path, CI-compatible PHPStan config, cspell words.

Created by: ajetiv1
Created on: 27 Oct 2026 at 17:18 UTC
Last updated: 27 Oct 2026 at 17:18 UTC
Bug fixes
New features

Other releases