Use EntityReferenceItemInterface::getReferenceableBundles() wherever core needs to discover reference-able entities for a field.

Created on 11 May 2022, over 2 years ago
Updated 4 July 2023, over 1 year ago

Problem/Motivation

EntityReferenceItemInterface::getReferenceableBundles() was introduced in πŸ› ResourceTypeRepository wrongly assumes that all entity reference fields have the setting "target_type" Fixed and deprecates entity reference fields that do not implement this interface; they must do so in Drupal 10.

This issue is a follow-up as foreseen in the original issue, to update any places in core where the field's settings are directly accessed, e.g. to determine the target_type. This will also improve compatibility with other field types, e.g. Dynamic Entity Reference.

ContentEntityBase::referencedEntities() will need updating, as it does:

> $property instanceof EntityReference

And generally, we should look through the whole codebase for anything which references either the EntityReference or EntityReferenceItem classes, or the entity_reference field type, and update them.

That could all be done in follow-ups though.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
FieldΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024