Clone form is not respecting 'cloneable_entities' config resulting in memory limit on recursive in ContentEntityCloneFormBase for a custom Entity.

Created on 27 October 2023, about 1 year ago
Updated 7 August 2024, 5 months ago

Problem/Motivation

Not sure how to reproduce since its a client project I did not build up from the ground. However there is a custom entity and a reference field to the entity inside a node. This custom entity is not clonable and should be disabled from cloning in the "/admin/config/system/entity-clone/cloneable-entities" page.

However, cloning the (parent) node results in a memory limit error already on the entity clone form page (/entity_clone/node/{NID}). Debugging the issue, I notice the ContentEntityCloneFormBase is using the "isClonable()" method but its not respecting the 'cloneable_entities' config. Excluding entity types only works on the 'clone' operation or the 'entity_type.definition.create' Event being fired which according to the comments "The name of the event triggered when a new entity type is created" only fires when a new entity type is created. This of course happens AFTER submitting the form.

Steps to reproduce

Not sure how to reproduce since its a client project I did not build up from the ground. I'm not sure why the custom entity is not clonable.

Proposed resolution

Add a check for clonable_entities for reference fields in the isClonable() method aswell.

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024