Remove entity button not showing in Complex Inline Entity Form after upgrading to 3.x from 1.x

Created on 23 August 2024, about 1 month ago

Problem/Motivation

After upgrading to 3.x from 1.x, Remove button in Complex Inline Entity Form is not being displayed in some cases.

After investigation, I found out that the issue originated from changes introduced in 🐛 Memory allocation error Fixed

Previously, countReferenceableEntities() was used to determine the count which returned the correct total count but was throwing memory issue for some users.
The changed code uses getReferenceableEntities(NULL, 'CONTAINS', 2). But this function returns list of entities grouped by Bundle name array key. Ref: https://git.drupalcode.org/project/drupal/-/blob/10.3.2/core/lib/Drupal/...
Hence, count($handler->getReferenceableEntities(NULL, 'CONTAINS', 2)) will always return 1 when only one entity bundle is involved and it will fail.

The below xdebug console SS should paint a clear picture.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India Supreetam09 Kolkata

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

Comments & Activities

Production build 0.71.5 2024