Fatal error: Maximum function nesting level of '256' reached, aborting! With Support for sub-entity cloning patch

Created on 15 February 2018, over 6 years ago
Updated 2 August 2023, 11 months ago

Using the dev version of the module and the patch for Support for sub-entity cloning @ https://www.drupal.org/project/entity_clone/issues/2706639 β†’ we get the error "Fatal error: Maximum function nesting level of '256' reached, aborting!" when the entity has a Entity Reference field that references entities of the same content type.

The message also shows that it's looping around these functions

Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->getRecursiveFormElement( )	.../ContentEntityCloneFormBase.php:89
Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->getChildren( )	.../ContentEntityCloneFormBase.php:186
Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->formElement( )	.../ContentEntityCloneFormBase.php:206
Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->getRecursiveFormElement( )	.../ContentEntityCloneFormBase.php:89
Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->getChildren( )	.../ContentEntityCloneFormBase.php:186
Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase->formElement( )	.../ContentEntityCloneFormBase.php:206

Seems that it's trying to clone entities within entities within entities which it probably shouldn't be doing.

Steps to duplicate:

1. Create a content type, save
2. Edit and add a Entity Reference field that references that same content type
3. Create a couple of nodes and edit and reference the other node
4. Try to clone and get this error

Not sure how to limit that recursive action or (right now) how to add the ability to not clone an Entity Reference field in the /admin/config/system/entity-clone settings page.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kamkejj WI

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡­Switzerland sir_squall

    I still go the error in the latest version of the module and in Drupal 9.5:
    Fatal error: Allowed memory size of 671088640 bytes exhausted (tried to allocate 20480 bytes) in .../core/lib/Drupal/Core/Field/FieldItemBase.php on line 109

Production build 0.69.0 2024