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, 8 months ago
Updated 27 May 2024, 27 days 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 work

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024