Support for entity_reference_revisions fields that contain media

Created on 5 June 2025, 4 months ago

Problem/Motivation

If the block contains cloned paragraphs which contain a media reference, the media doesn't display in the cloned paragraph in layout builder. The media reference is there, I can see it when I debug and it also displays on the node canonical route. But in Layout Builder preview it looks as though no media has been added in the preview and when viewing the block form.

Note that I am not cloning the media, I am just adding the same target ID that exists in the original block. The media displays in the original block but not the cloned block. The block form appears as though no media has been added.

It looks as though it might be an access issue. It seems odd because the very same media item is displaying in a block in the same section.

Steps to reproduce

  1. Add an inline block that contains a paragraph. The paragraph has a media reference field. Add media to the block.
  2. Clone the block
  3. See that the media does not display in the cloned block

This is the case whether using entity_clone or not. Note that if you are not using entity_clone you need the patch from here: https://www.drupal.org/project/layout_builder_block_clone/issues/3416926 🐛 Support for entity_reference_revisions fields Needs review

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.2

Component

Code

Created by

🇨🇦Canada laura.j.johnson@gmail.com Toronto

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

Comments & Activities

Production build 0.71.5 2024