Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295547

Entity types w/o bundle key should not be able to define multiple bundles

$
0
0

Problem/Motivation

An entity type that has no bundle key (i.e. $entity_type->hasKey('bundle') === FALSE) is still able to expose multiple bundles, via hook_entity_bundle_info(). This is a logical nonsense. Not having a bundle key means: this entity type have no bundle (like the user entity type).

Proposed resolution

Don't allowhook_entity_bundle_info() (and hook_entity_bundle_info_alter()) to populate the bundle info list (see EntityTypeBundleInfo), with more than one entry which is the entity type ID itself, for such entity types.

Eventually consider deprecating such practice in the first step.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.


Viewing all articles
Browse latest Browse all 295547