diff --git a/core/lib/Drupal/Core/Entity/EntityTypeManager.php b/core/lib/Drupal/Core/Entity/EntityTypeManager.php index 9115da2..fdf71b1 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeManager.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeManager.php @@ -75,7 +75,7 @@ class EntityTypeManager extends DefaultPluginManager implements EntityTypeManage * The class resolver. */ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache, TranslationInterface $string_translation, ClassResolverInterface $class_resolver) { - parent::__construct('Entity', $namespaces, $module_handler, 'Drupal\Core\Entity\EntityInterface'); + parent::__construct('Entity', $namespaces, $module_handler, EntityInterface::class, EntityType::class); $this->setCacheBackend($cache, 'entity_type', ['entity_types']); $this->alterInfo('entity_type'); @@ -89,7 +89,8 @@ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $mo */ protected function getDiscovery() { if (!$this->discovery) { - $this->discovery = new AnnotatedClassDiscovery('Entity', $this->namespaces, EntityType::class); + // Opt out of derivative discovery set up by parent::getDiscovery(). + $this->discovery = new AnnotatedClassDiscovery($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces); } return $this->discovery; } diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php index 80c3df0..be636bf 100644 --- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php +++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php @@ -23,6 +23,7 @@ protected function setUp() { // Fetch the definitions before installing the theme to prime the cache. \Drupal::service('breakpoint.manager')->getDefinitions(); + // Installing a theme will reset the cached definitions and discovery. \Drupal::service('theme_handler')->install(['breakpoint_theme_test']); }