Skip to content
Snippets Groups Projects
Commit 8891a509 authored by joachim's avatar joachim Committed by Bojan Zivanovic
Browse files

Issue #3028820 by joachim: throw an exception if an entity using bundle...

Issue #3028820 by joachim: throw an exception if an entity using bundle plugins doesn't have a 'bundle' entity key
parent 39d87051
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,10 @@ function entity_get_bundle_plugin_entity_types() {
function entity_entity_type_build(array &$entity_types) {
foreach ($entity_types as $entity_type) {
if ($entity_type->get('bundle_plugin_type')) {
if (!$entity_type->hasKey('bundle')) {
throw new \LogicException(sprintf('The %s entity type uses a bundle plugin type but has no bundle key.', $entity_type->id()));
}
if (!$entity_type->hasHandlerClass('bundle_plugin')) {
$entity_type->setHandlerClass('bundle_plugin', BundlePluginHandler::class);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment