Problem/Motivation

If someone clones any Layout Builder-enabled entity that has inline block content, and then subsequently deletes the original entity, the inline blocks on the cloned entity will be deleted on the next cron run. Content editors will see a "This content is missing or broken" message while in "Layout editing" mode. In "View" mode, the node will omit the content altogether. The missing content cannot be recovered.

Steps to reproduce

1. From a clean site installation, enabled "Layout Builder" and "Entity Clone" and configure a node type to use Layout Builder.
2. Create a page and add a single inline block of any type to the the layout.
3. Clone the page. The content will look fine.
4. Delete the original node. The content on the cloned node will still appear.
5. Run cron.
6. View the cloned page. The content on the cloned node will be missing.

Root cause

The entity_clone module clones Layout Builder-style entities by copying verbatim the data in [entity]__layout_builder__layout from one entity to the next. This data copies the block ID of inline blocks as-is. This works just fine for allowing content changes between the nodes to differ, since changes are stored as new block **revision** IDs.

Example of why things work fine *before* deletion:
- Start with a site empty of content. Create a Layout Builder node with a single inline block.
- Node 1 will now have an inline block with ID 1. That block's revision number is also 1.
- Change the content of that inline block. Node 1 now references block 1, revision 2.
- Clone node 1. A New node, 2, is created. It references block 1, revision 2 (i.e., copied verbatim).
- Change node 1's block. It now references block 1, revision 3, while node 2 still references revision 2.
- Change node 2's block content. It now references block 1, revision 4, while Node 1 still references block 1, revision 3.

The problem arises when the original node is deleted. This marks the inline block with ID 1 as ready for deletion. When layout_builder_cron() executes during the next cron run, it deletes block ID 1, along with all of its revisions, and the content on Node 50 is lost.

Proposed resolution

First, adjust the behavior of the entity_clone module so that when Layout Builder-style entities are cloned, inline blocks are resaved as new blocks with distinct block IDs. This is the correct solution from the standpoint of Layout Builder's architecture: an inline block is expected only to be referenced in one place.

However, this alone will not fix entities cloned prior to the proposed change.

So, second, add an update hook to examine each row in [entity]_revision__layout_builder__layout and count the instances of block references and then re-save ones that have more than one count and update the data in [entity]__layout_builder__layout and [entity]_revision__layout_builder__layout with the new block ids. Special care should be taken to preserve revisions of these newly created blocks (and thus preserve the ability to revert to a previous revision of the node).

Finally, since there are likely some sites with already-missing and unrecoverable blocks, create an audit tool that can identify these for site owners.

User interface changes

None.

API changes

Inline blocks should always be duplicated during clone.

Data model changes

None.

CommentFileSizeAuthor
#88 entity_clone_3050027_88.patch21.87 KBmanojapare
#87 interdiff_81_87.txt5.52 KBmanojapare
#87 entity_clone_3050027_87.patch21.47 KBmanojapare
#86 Screenshot from 2025-07-10 17-20-28.png47.83 KBolegrymar
#81 3050027--inline-blocks-on-layout-builder-fail-to-clone-correctly.patch20.52 KBlisa.rae
#76 SCR-20240717-ihhv.png105.89 KBfroboy
#74 Accordion_Block_Clone.png36.4 KBcarolpettirossi
#62 3050027-62.patch20.31 KBmohammedodeh
#52 entity_clone-clone_layout_builder-3050027-52.patch20.71 KBcarolpettirossi
#49 layoutbuilder.patch17.41 KBkazajhodo
#40 interdiff_38-40.txt2.99 KBtim-diels
#40 entity_clone-clone_layout_builder-3050027-40.patch20.82 KBtim-diels
#38 entity_clone-clone_layout_builder-3050027-38.patch18.99 KBtim-diels
#34 entity_clone-clone_layout_builder-3050027-34.patch19.56 KBredwan jamous
#32 entity_clone-clone_layout_builder-3050027-32.patch20.78 KBtobas1996
#7 3050027-inline-block-clone.patch11.03 KBWeilinggu
#8 3050027-inline-block-clone-v2.patch9.38 KBWeilinggu
#10 3050027-inline-block-clone-v3.patch10.41 KBWeilinggu
#11 3050027-inline-block-clone-combine-3060223.patch12.29 KBWeilinggu
#12 3050027-inline-block-clone-combine-3060223-v2.patch13.28 KBWeilinggu
#13 3050027-inline-block-clone-combine-3060223-v3.patch13.21 KBWeilinggu
#14 3050027-inline-block-clone-combine-3060223-v4.patch13.29 KBWeilinggu
#19 entity-clone-clone-layout-builer-3050027-19.patch19.87 KBAndyThornton
#26 entity_clone-clone_layout_builder-3050027-26.patch21.15 KBemek
#29 entity_clone-clone_layout_builder-3050027-29.patch21.06 KBmichaellander
#30 entity_clone-clone_layout_builder-3050027-30.patch20.09 KBn.ghunaim
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

josephdpurcell created an issue. See original summary.

josephdpurcell’s picture

I'm wondering if this could be considered "works as designed"? This is a difficult scenario because clone is cloning the immediately referenced entity fine, the block, but not cloning the entity that the block references, the paragraph. I wonder if media has a similar problem.

Does anyone have tips or considerations on how to resolve this? Does this also apply to media?

Note: I didn't find any other tickets about this issue. If there is another please close this as a duplicate.

anybody’s picture

https://www.drupal.org/project/quick_node_clone has a fix for this built-in, perhaps you could join efforts and take the solution for this module. As paragraphs (if not paragraph library used) are always "owned" by the parent entity, they have to be copied and not referenced.

Until that is fixed we're using https://www.drupal.org/project/quick_node_clone

entity_clone helps us to clone bundles / configuration.

hudri’s picture

Priority: Normal » Critical

This must not be considered "works as designed": Paragraphs (P) are Entity Reference Revisions (ERR), and contrary to normal Entity References like media an ERR must have exactly one parent. If we don't adhere this role, this will lead to inconsistent data at best (every time a shared P parent is edited, a new revision of the P is also created, all other parents would point to an outdated P version), or unrecoverable data loss at worst (when one parent of a shared P is deleted).

Bumping status to critical due the potential data loss in this scenario.

anybody’s picture

Not only other cloning modules, but also devel_generate and similar modules have the same problems, perhaps we should place a common issue into ERR?

See #2568187: Improve EntityReferenceRevisionsItem::generateSampleValue to be recursion-safe and devel_generate compatible

acbramley’s picture

Priority: Critical » Major

This is definitely not critical, but cloning content with blocks added via Layout builder isn't working properly in general (across both entity_clone and replicate). The scenario described as working in the Issue summary isn't really working properly due to the fact that the blocks themselves aren't cloned which leads to both Nodes referencing the same block via LB (these are marked as not reusable so should only ever be used by 1 entity). I think fixing that would fix the paragraphs issue as well.

Weilinggu’s picture

StatusFileSize
new11.03 KB

Been working on making layout builder and entity clone work together. This patch seemed to have been working for my case.

Testing steps:
1. Enable layout builder
2. Create a custom block type and two paragraph types. Place child paragraph within parent paragraph, then place parent paragraph within custom block type
3. Create a content type
4. In Manage Display, enable "Use Layout Builder" and "Allow each content item to have its layout customized."
5. In "BLOCKS AVAILABLE FOR PLACEMENT", allow placement of custom blocks
6. Create test node, in [node_path]/layout, add a block and select create custom block and select the block type you created
7. Save layout.
8. Clone node
9. In the cloned node, go to [node_path]/layout, edit the block and save
10. Go back to the original node layout ([node_path]/layout), try to edit the block and save.
11. You should see no locked paragraph or blocks

Weilinggu’s picture

StatusFileSize
new9.38 KB

Removed the layout_builder dependency and moved it into after the check of layout builder existence

Weilinggu’s picture

Status: Active » Needs review
Weilinggu’s picture

StatusFileSize
new10.41 KB

After applying patch in https://www.drupal.org/project/entity_clone/issues/3060223, I noticed there is an issue where the layout field in the original node is referencing the new block revision. This patch will fix the issue, and also make sure this patch work with the patch in issue https://www.drupal.org/project/entity_clone/issues/3060223

Weilinggu’s picture

I was not able to apply both my patch and the patch in https://www.drupal.org/project/entity_clone/issues/3060223 through composer, since they are modifying the same file. So I rolled the patch in https://www.drupal.org/project/entity_clone/issues/3060223 into my patch as well. For those who need both, here it is

Weilinggu’s picture

The previous roll was incorrect. This should work now. I hope...

Weilinggu’s picture

Fixing a problem in the previous patch where node clone with multiple blocks or sections

Weilinggu’s picture

Fixing issue with fields in custom layout that has no block revision ID is not getting cloned properly

AndyThornton’s picture

I am afraid that this patch does not work well on multilingual systems.

If you create a node that is using layout builder with two translations and then visit the 'clone' tab you only see the layout builder blocks for the locale you are on, but when you click 'clone' you get a copy containing all locales. The resultant clone will likely always be not what the user expects. The locales you were not on will just be pointers ... is kinda like if this patch wasnt being used for those locales.

AndyThornton’s picture

Status: Needs review » Needs work
AndyThornton’s picture

I fear the core problem here, though, may not be with your addition. I could be understanding this wrong, but ContentEntityCloneBase::cloneEntity probably should be looping over the locales associated with the entity. It calls 'get' on the field, but this is only going to return the field version of the active language (see ContentEntityBase::get)

AndyThornton’s picture

@weilinggu I am working on the next version of this patch ... am nearly there.

I just noticed in your change that you save the 'original' entity as well as the clone. Was this intentional? I am taking it out, but please let me know, if you can.

Cheers!

AndyThornton’s picture

Attached is another patch. This handles the multilingual case.

One question I have, though. Do we need any adjustments to the form for this entire goals? The previous version of the patch modified the form so I kinda left it (although made the field set and disabled). The code that processes the form ignores the settings on the form for layout fields, which actually seem right (a layout builder field should always be deeply cloned to avoid any system integrity issues). Maybe it is needed for even deeper cloning within a layout field? (not my use-case).

AndyThornton’s picture

Status: Needs work » Needs review
Susmitha_Nagaboina’s picture

Assigned: Unassigned » Susmitha_Nagaboina
Priority: Major » Normal

Some Findings to patch:

While I am cloning a page with so many entity references.It is throwing this error:

Maximum functioning nesting level of '256' reached aborting! in Drupal\Component\Utility\Html::getId() (line 218 of core/lib/Drupal/Component/Utility/Html.php).

Usually all the entities are displayed before clicking on clone button.But if there are many entities then it is not able to display and it is throwing above error.
So I have removed these lines:

if ($referenced_entity instanceof ContentEntityInterface) {
$form_element[$field_definition->id()]['references'][$referenced_entity->id()]['children'] = $this->getChildren($referenced_entity, $discovered_entities);
}

in getRecursiveLayoutFormElement() in 3050027-inline-block-clone-combine-3060223-v4.patch.

So now only first level elements are displayed before clicking on clone button.
But I am able to clone all the entities.

ngkoutsaik’s picture

Hi,

thanks for the detailed steps on how to reproduce this error. I followed your steps but never got your error.

Side note, I had an error with the paragraphs module when saving the layout on the original note. Integrity constraint violation: 1048 Column 'langcode' cannot be null

I used this patch to fix it. I am not certain at this point if that somehow affected the result.

I will leave this to review hoping that someone might have a different answer.

barone’s picture

I'm wondering if this issue is really related to Layout builder since there's a similar tread on Paragraphs module bug with Entity Clone and no Paragraphs is mentioned there: https://www.drupal.org/project/entity_clone/issues/3060223

sakiland’s picture

This should be fixed in Entity Reference Revisions module.

Please check this issue #3190915: New revision is not created via Layout Builder

emek’s picture

I have an issue with blocks in layout builder. I have a simple block with just a body field.
When I clone a node with one of those blocks added in layout builder everything looks fine. However after I edit the block in the clone it just gets edited there (which is fine, it's what I expect), but after that I can't edit the block on the original node. They seem to still reference the same block id but have different revisions.
I tried the patch in #19 and after that I can edit the two blocks individually. I want to hide the checkbox on the "Clone" page but even after I check everything on /admin/config/system/entity-clone it still shows.

emek’s picture

I have updated the patch from #19 so it works with the latest version of the module. I have also added a setting to hide the Layout builder checkboxes on the clone page.

spicy.werewolf’s picture

spicy.werewolf’s picture

michaellander’s picture

Rerolled again against latest dev.

n.ghunaim’s picture

Face an issue when applying the patch on comment #26 with the patch mentioned on the following issue https://www.drupal.org/project/entity_clone/issues/3114597,
that the label "- Cloned" starts to replicate depending on the number of available translations.
So I updated the patch and tested it with a multilanguage site and it worked well for me.

n.ghunaim’s picture

After deep testing, the patch on comment #30 fails to work with translation entities.
So the patch on comment #26 working well for me as it fix two related issues also:
https://www.drupal.org/project/entity_clone/issues/3114597 & https://www.drupal.org/project/entity_clone/issues/3060223

tobas1996’s picture

I aplied the patch #30, and i found just a little issue. You forgot to set config "hide_layout_builder_referenced_entities" on submit form.

Thank you for the patch! It's working fine cloning blocks with images, blocks with paragraphs inside, nodes with taxonomies, etc...

I'm attaching the same patch with this additional little fix.

anybody’s picture

Thanks for finding that out @tobas1996 - could you perhaps provide an interdiff?

Afterwards it would be cool if someone from the issue could review it :)

redwan jamous’s picture

Updated patch #32 to work with the latest version (8.x-1.0-beta7).

tim-diels’s picture

Assigned: Susmitha_Nagaboina » Unassigned
tim-diels’s picture

Status: Needs review » Needs work

@RedwanJamous thanks for the patch for the latest beta version, but there is no need to let the test runners run for a patch that does not apply to the latest dev branch.

For the rest are here some remarks for the patches:

  • The patches create a not needed/willing dependency on Layout Builder. Needs to be adjusted so there is no dependency on a module that is not always installed.
  • The patches create a not needed/willing dependency on Block content. Needs to be adjusted so there is no dependency on a module that is not always installed.
  • Doc comment not complete for construct function in latest patch.
tim-diels’s picture

Version: 8.x-1.x-dev » 2.x-dev

As the issue is also existent in the 2.x, I suggest we focus on fixing it in the 2.x

tim-diels’s picture

Status: Needs work » Needs review
StatusFileSize
new18.99 KB

The patch has been rewritten to work for 2.x, but also applies to 1.x.
I only tested the functionality in the 2.x branch.

tim-diels’s picture

Status: Needs review » Needs work

After testing with a multilingual setup, the translated content is still broken.

tim-diels’s picture

Status: Needs work » Needs review
StatusFileSize
new20.82 KB
new2.99 KB

Tried to fix the multilingual part, but needs proper testing.

mark_fullmer’s picture

Title: Block with Paragraph on Layout Builder Fails to Clone Correctly » Inline Blocks on Layout Builder Fail to Clone Correctly
mark_fullmer’s picture

Issue summary: View changes
mark_fullmer’s picture

Manual functional testing of the patch in #40 checks out.

I plan to work on functional tests, including demonstration of the multilingual work, in the coming days.

From #36:

The patches create a not needed/willing dependency on Layout Builder. Needs to be adjusted so there is no dependency on a module that is not always installed.

Is this still an issue? The ContentEntityCloneBase class includes two classes that invoke Layout Builder services/classes, but they are conditioned on $this->moduleHandler->moduleExists('layout_builder'), and the Form classes' methods involving the SectionListInterface are conditioned on $field_definition->getType() === 'layout_section'.

We could make conditional the rendering of $form['hide_layout_builder_referenced_entities'], but its presence isn't problematic if sites don't have Layout Builder installed.

tim-diels’s picture

Hey Mark, the dependencies were not a problem as the modules are core dependencies. I was a bit to fast saying that the dependencies could be a problem.

To me the patch works, but one problem still remains and that is that paragraphs in an inline block are still referenced. So changing the data on a node changes it on the clone and visa versa. So I created a simple extra patch removing the blocks with paragraphs. Will upload that one when I am after my pc. Still a big issue but with the patch it is workable.

But we may look at #29 approach. Found out that the later patches were a bit different. But #29 looks like they maybe have code/functionality that could help.

mark_fullmer’s picture

General FYI for folks following this issue: our Drupal development team, which supports many sites that have been using entity_clone, was concerned about the potential data loss described in this issue. Although the latest patch resolves the issue for newly created blocks, blocks created before the patch is applied will still be vulnerable to being deleted from referenced entities when the original entity is deleted (as explained in the issue description).

So we wrote a process to fix existing blocks. The snippet in https://gist.github.com/markfullmer/80c606d4e3945c33b34eba9615b23d91 will only remediate entities of type "node," which is probably sufficient for almost all use cases, but it could be abstracted to account for other entities. This code could be called in a site update hook or via a custom drush command.

We hope this is useful for other folks facing the same concern.

Notes: the above code accounts for inline blocks referenced across multiple clones by duplicating the original block for each entity reference, and also cleans up tempStore values (i.e., if someone has modified a layout but not yet hit "save").

nicklasmf’s picture

I've tried apply #38 and #40 to 8.x-1.0 but it fails (at least for me).

As 2.x is still in Alpha, I hope the patch can be a subject to 1.x?

kazajhodo’s picture

@NicklasMF, this confused me at first as well.

The #40 patch applies cleanly to the dev.

Although I am still running into what seems to be a clone issue.

The inline_block_usage references are saved without layout_entity_id. I don't know... but I'm guessing there is another query that runs to apply the layout_entity_id. Seems like it needs an on duplicate update... but then on revisions it would likely need an insert.

With or without the patch I encounter the same result.

If I go into the database, and manually add the layout_entity_id values, the issue goes away.

When the clone fails, all of the inline_block_usage layout_entity_id will be NULL.

I'm not positive, but I think the issue is in InlineBlockEntityOperations, line 234, $this->usage->addUsage(). An entity is always passed, but in some cases the entity id is not set. So when the entity hits addUsage(), there is no entity id. Then you end up with orphaned block_content_id rows, empty layout_entity_id.

If a check is added for entity id before addUsage() is fired, the clone works fine.

kazajhodo’s picture

StatusFileSize
new17.41 KB

I made a patch... of a patch.

When I went to apply my patch, I was editing already patched code.

Original patch.

My combined patch is attached. I did it this way as I'm not all that convinced its the correct way to do it; but at my experience level it seems like the proper place.

This seems to make the clone work fine, and then saves as expected.

abu-zakham made their first commit to this issue’s fork.

carolpettirossi’s picture

I've tested the latest code from MR #42, and it works as expected in my scenarios.

Without cloning the inline blocks, when I edited the cloned page via the Layout tab, the blocks were there; however, preview of paragraphs was not possible due to the parent entity being incorrect.

Attaching the patch to use in composer.json.

Thank you everyone working on this! :))

amitchell-p2’s picture

For those tracking different parts of this across several issues:

Using #52, I was running into the issue mentioned in #48.

Just added a new patch (#36) on 2062819 that should solve the missing id issue by using reflection to get the entity id from the plugin:

https://www.drupal.org/project/drupal/issues/3062819#comment-15053937

Rajeshreeputra made their first commit to this issue’s fork.

mikeryan’s picture

Status: Needs review » Needs work

Needs reroll.

carolpettirossi’s picture

Updated the MR with the latest code from beta4. Working as expected on my layout builder projects :)

anpolimus’s picture

Last MR diff, updated by @carolpettirossi applies to the beta4 version and fixes the issue.

podarok’s picture

Priority: Normal » Major
Status: Needs work » Reviewed & tested by the community
anpolimus’s picture

I tested on a couple of projects the last fix. Last MR fixes the problem on both.
I think it is ready for RTBC but we need somebody else to verify everything is fine.

gillarf’s picture

I've tested the last MR and it works on my project.

mohammedodeh’s picture

StatusFileSize
new20.31 KB

Reroll the patch to version 2.0.0-beta4

rajeshreeputra’s picture

Status: Reviewed & tested by the community » Fixed

Merged, release to follow shortly. Thank you for working on it!!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

andyg5000’s picture

Thanks for everyone that worked on this.

Whenever a major bug that can cause data to be deleted is fixed/merged, can we get a new release with it? Please.

lupusgr3y’s picture

Why on earth has this not been released yet? This is so important!

rajeshreeputra’s picture

Sorry for delay, released!

joevagyok’s picture

Status: Closed (fixed) » Needs work

The merged code from this issue introduced a bug on the latest beta5 release!
I understand the urgency of the layout builder issue, but we can't merge code without tests!

I see code fragments from #3258535: Translatable entity reference fields are not cloned correctly ended up in the merge request, which basically loops through the languages and clones entities all over the place without actually preventing to create several duplicates and filling up the database with orphan entities. With manual testing, you can't detect such problems! Not to mention that the issue is not even fixed yet!
Nevertheless, adding layout builder specific logic in a base class seems far from correct.

Apologies to the layout builder community members, but I opened a merge request in #3437645: Revert "Inline Blocks on Layout Builder" issue which introduced a bug of duplicate entity clones to revert this issue and make a new release as it is currently broken and create an opportunity to fix the problems and implement tests.

  • Rajeshreeputra committed df1c9084 on 2.x
    Revert "Issue #3050027 by carolpettirossi, tim-diels, Rajeshreeputra,...
rajeshreeputra’s picture

As the latest release with merge introduced #3437645: Revert "Inline Blocks on Layout Builder" issue which introduced a bug of duplicate entity clones hence reverted and released new tag. Thank you @joevagyok for reporting, you can close the another issue.

carolpettirossi’s picture

StatusFileSize
new36.4 KB

The MR 67 is working as expected on my project. However, in my case, the content editors must be very careful and select the checkbox to clone the blocks inside blocks.
We are not using paragraphs.
For example, we have an Accordion block. Within the Accordion block type we have a Accordion Items field that you can reference Accordion Item block type.
If the editors are not careful in selecting those fields, they may have references to existing blocks and edits will be performed on the origin as well.

Screenshot showing the block content clone

It would be nice to get a config to "Select all block_content" when cloning the entity.

froboy made their first commit to this issue’s fork.

froboy’s picture

StatusFileSize
new105.89 KB

Brought patch up to date with the latest in the 2.x branch.

@carolpettirossi you might check out Admin > Configuration > System > Entity clone settings (/admin/config/system/entity-clone. It has some configuration options that can be very helpful to users.

Enforcing "Checkboxes default value" and "Disable checkboxes" means that all (non-reusable?) blocks will be cloned by default and the boxes will be shown to the user as checked and disabled. Additionally, checking "Hide Layout builder referenced entities checkboxes" will hide the checkboxes altogether for an even cleaner cloning experience.

Screenshot of the Entity clone settings page with the options described above highlighted

joevagyok’s picture

Issue tags: +Needs tests

Carlos Romero made their first commit to this issue’s fork.

lisa.rae’s picture

Rolled the latest MR included in https://www.drupal.org/project/entity_clone/issues/3050027#comment-15745284 as a patch for those who need to apply this, but for security reasons cannot use a diff of a MR.

lisa.rae’s picture

So couple of questions:

joevagyok’s picture

This issue is not close to be merged and here are some reasons why:

  • The MR still introduces a bug which creates more cloned entities in certain conditions that it should. This can be only detected by automated tests asserting the amount of entities in the database after each clone operation.
  • The base class meant for content entities should not contain layout builder specific logic, not every site has layout builder.
  • There are certain entity types and entity reference combinations that are not entirely clear how we should proceed like Accordion and its items.
  • The MR needs automated tests.

These have to be addressed before we make a review.

lisa.rae’s picture

Thank you @joevagyok!

In my particular instance the client has LayoutBuilder, which is the root of the issue we were having.

For those having issues with Layout Builder sites, the patch in #81 is a roll of the MR in #78, and applies cleanly to a site running Drupal 10.3 with LayoutBuilder enabled, and Entity Clone version 2.1.0-beta1.

whereiam’s picture

When a Layout Builder (LB) block with media is cloned, the media is cloned too. If the media is removed, it is also removed from the parent node.

olegrymar’s picture

StatusFileSize
new47.83 KB

@whereiam
I have not reproduced the problem you described. https://www.drupal.org/project/entity_clone/issues/3050027#comment-16066461
Please go to /admin/config/system/entity-clone and make sure you selected "Media" as a "clonable" entity type.

Media

manojapare’s picture

StatusFileSize
new21.47 KB
new5.52 KB

Thanks for the patch #81 @lisa.rae. Have fixed 2 things which I found:

  1. In layout builder, content block which are not revision able are skipped from cloning.
  2. Missing label suffix for content block in layout builder.
manojapare’s picture

StatusFileSize
new21.87 KB

Missed to add a fix in above patch.

mattlc’s picture

I think there is another approach to take into account for this issue. Layout builder inline content blocks are actually "inline entities".
This means that they really belong to their host entity and the module that "declare" the entity have to implement the "inline entity" mecanism :

  • ensure that the entity is associated to only one host entity
  • expose the access dependency to allow the host entity to define the child access (see \Drupal\Core\Access\AccessibleInterface\DependantAccessInterface)
  • save the host-child relationship somewhere to be able to attach the host-child operations (delete orphan...).

We should rely on that to know if the child entity has to be cloned or not (whatever the config). => If child is an inline entity then clone.

carolpettirossi’s picture

I rebased the 2.x fork so MR88 can be applied to the 2.2.0-beta1 version successfully.