Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
-
BlockManager always uses
createInstance()
instead ofgetInstance()
. -
This means that BlockManager never knows whether it previously tried to instantiate a plugin and whether that failed.
-
When manually triggering a PHP notice in StaticReflectionParser, you get this:
Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request() Notice: Undefined variable: className in Doctrine\Common\Reflection\StaticReflectionParser->parse() (line 122 of core\vendor\doctrine\common\lib\Doctrine\Common\Reflection\StaticReflectionParser.php). Doctrine\Common\Reflection\StaticReflectionParser->parse() Doctrine\Common\Reflection\StaticReflectionParser->getDocComment() Doctrine\Common\Reflection\StaticReflectionClass->getDocComment() Doctrine\Common\Annotations\AnnotationReader->collectParsingMetadata(Object) Doctrine\Common\Annotations\AnnotationReader->getImports(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object) Doctrine\Common\Annotations\AnnotationReader->getClassAnnotation(Object, 'Drupal\Core\Annotation\Plugin') Drupal\Component\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\AlterDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinitions() Drupal\Core\Plugin\Discovery\CacheDecorator->getDefinition('menu_menu_block:devel') Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('menu_menu_block:devel', Object) Drupal\block\Plugin\Type\BlockManager->createInstance('menu_menu_block:devel', Array, Object) Drupal\block\Plugin\Core\Entity\Block->getPlugin() Drupal\block\{closure}(Object) array_filter(Array, Object) Drupal\block\BlockStorageController->load() Drupal\block\BlockStorageController->loadByProperties(Array) entity_load_multiple_by_properties('block', Array) block_list('sidebar_first') block_get_blocks_by_region('sidebar_first') block_page_build(Array) drupal_render_page(Array) Drupal\Core\EventSubscriber\ViewSubscriber->onHtml(Object) Drupal\Core\EventSubscriber\ViewSubscriber->onView(Object) call_user_func(Array, Object) Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object) Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object) Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) Drupal\Core\HttpKernel->handle(Object, 1, 1) Symfony\Component\HttpKernel\Kernel->handle(Object) drupal_handle_request()
Comment | File | Size | Author |
---|---|---|---|
#5 | drupal8.plugin-definitions.5.patch | 12.46 KB | sun |
#2 | drupal8.plugin-definitions.2.patch | 15.9 KB | sun |
Comments
Comment #1
EclipseGc CreditAttribution: EclipseGc commentedI think I'm missing some context, can you show what you did in order to do this? I'm going to have trouble helping here until I know what you're doing to get these exceptions.
Eclipse
Comment #2
sunLet's see what this buys us.
Comment #3
tim.plunkettAbout half of this is #1892462: EntityManager should use the CacheDecorator, I'm hoping you borrowed the code and didn't do all of the same work.
I'd imagine you'll have the same issues with static caching I did.
Comment #5
sun#1892462: EntityManager should use the CacheDecorator landed, so let's see whether this is any better.
Comment #7
tim.plunkettOne thought would be to introduce a public resetDefinitions() method on PluginManagerInterface, and PluginManagerBase::resetDefinitions() would just do
$this->definitions = array();
Or expand clearCachedDefinitions() to handle that.
Comment #8
BerdirNot sure if anything here is still relevant, we have fallback plugins and we don't reparse plugins when one is missing AFAIK.
Comment #16
pameeela CreditAttribution: pameeela commentedThanks everyone for contributing to this issue.
As part of the Bug smash initiative, we are triaging issues that are marked 'Postponed (maintainer needs more info)'. Based on Berdir's comment and the lack of any additional information, we believe this issue is no longer relevant so I am marking it 'Closed (outdated)'.
Comment #17
BerdirYou didn't actually do that though :)
Comment #18
pameeela CreditAttribution: pameeela commentedWhoops! That is an important step. Thanks :)