Skip to content
Snippets Groups Projects
Commit 18cc119d authored by Manuel Adán's avatar Manuel Adán
Browse files

Issue #3439042 by manuel.adan: Cannot create holders for content entities without bundles

parent 306a3966
No related branches found
No related tags found
1 merge request!8Prevent exception if no bundle set when holding entity.
......@@ -161,7 +161,8 @@ class EntityHolder extends ConfigEntityBase implements EntityHolderInterface {
throw new \InvalidArgumentException('Entity type mismatch.');
}
if ($this->getHeldEntityBundle() != $entity->bundle()) {
$expected_bundle = $this->getHeldEntityBundle();
if (!empty($expected_bundle) && $expected_bundle != $entity->bundle()) {
throw new \InvalidArgumentException('Entity bundle mismatch.');
}
......
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