diff --git a/src/MetaEntityRepository.php b/src/MetaEntityRepository.php index a0f989e..dcc588f 100644 --- a/src/MetaEntityRepository.php +++ b/src/MetaEntityRepository.php @@ -180,10 +180,10 @@ class MetaEntityRepository implements MetaEntityRepositoryInterface { */ public function getTypesWithAutoCreation(ContentEntityInterface $entity): array { $cid = 'auto_create'; - $bundle = $entity->bundle() ?: $entity->getEntityTypeId(); + if ($cache = $this->cache->get($cid)) { - if (isset($cache->data[$entity->getEntityTypeId()][$bundle])) { - return $cache->data[$entity->getEntityTypeId()][$bundle]; + if (isset($cache->data[$entity->getEntityTypeId()][$entity->bundle()])) { + return $cache->data[$entity->getEntityTypeId()][$entity->bundle()]; } return []; } @@ -206,8 +206,8 @@ class MetaEntityRepository implements MetaEntityRepositoryInterface { // Cache the results. $this->cache->set($cid, $cache, Cache::PERMANENT, $cache_tags); - if (isset($cache[$entity->getEntityTypeId()][$bundle])) { - return $cache[$entity->getEntityTypeId()][$bundle]; + if (isset($cache[$entity->getEntityTypeId()][$entity->bundle()])) { + return $cache[$entity->getEntityTypeId()][$entity->bundle()]; } return []; }