Entity Finder Plugin to support fieldable fields on content entities without bundles

Created on 8 April 2025, 11 days ago

Problem/Motivation

The current implementation of the Feeds Tamper Entity Finder Plugin assumes that Custom Content Entities without bundles will not have fieldable fields. This assumption is incorrect and leads to the plugin not working correctly for custom content entities that don't use bundles but still have fieldable fields.

Steps to reproduce

Create a custom content entity type without bundles but with fieldable fields.
Attempt to use the Feeds Tamper Entity Finder Plugin with this entity type.
Observe that the plugin fails to retrieve the fields for the entity type.

Proposed resolution

Replace the existing code in the getFieldDefinitions() method with the following:

$field_definitions = [];
if (!$this->entityTypeSupportBundles($entity_type_id)) {
  // Return only base field definitions.
  $field_definitions = $this->entityFieldManager->getFieldDefinitions($entity_type_id, $entity_type_id);
}

This change ensures that for entity types without bundles, the method always returns the base field definitions, regardless of whether the entity type is a custom content entity or not.

Remaining tasks

Update the getFieldDefinitions() method in the EntityFinder class with the proposed code.
Test the plugin with various entity types, including custom content entities without bundles, to ensure it works correctly in all scenarios.
Update any relevant documentation or comments in the code to reflect this change.

User interface changes

No user interface changes are required for this fix.

API changes

There are no API changes. This fix modifies the internal logic of the plugin but does not affect its public interface.

Data model changes

No data model changes are required for this fix. The change only affects how the plugin retrieves field definitions for entity types without bundles.

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇧🇪Belgium baikho Antwerp, BE

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