Trying to add a field of Block plugin type in Drupal 9 ( 9.0.6 )
TypeError: Argument 1 passed to Drupal\\Core\\Cache\\CacheableMetadata::applyTo() must be of the type array, null given, called in /var/www/docroot/modules/contrib/plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php on line 76 in /var/www/docroot/core/lib/Drupal/Core/Cache/CacheableMetadata.php on line 135 #0 /var/www/docroot/modules/contrib/plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php(76): Drupal\\Core\\Cache\\CacheableMetadata->applyTo(NULL)\n#1 /var/www/docroot/modules/contrib/plugin/src/Plugin/Field/FieldWidget/PluginSelector.php(60): Drupal\\plugin\\Plugin\\Plugin\\PluginSelector\\AdvancedPluginSelectorBase->buildSelectorForm(Array, Object(Drupal\\Core\\Form\\SubformState))\n#2 [internal function]: Drupal\\plugin\\Plugin\\Field\\FieldWidget\\PluginSelector::processFormElement(Array, Object(Drupal\\Core\\Form\\FormState), Array)\n#3 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1010): call_user_func_array(Array, Array)\n#4 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1073): Drupal\\Core\\Form\\FormBuilder->doBuildForm('field_config_ed...', Array, Object(Drupal\\Core\\Form\\FormState))\n#5 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1073): Drupal\\Core\\Form\\FormBuilder->doBuildForm('field_config_ed...', Array, Object(Drupal\\Core\\Form\\FormState))\n#6 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1073): Drupal\\Core\\Form\\FormBuilder->doBuildForm('field_config_ed...', Array, Object(Drupal\\Core\\Form\\FormState))\n#7 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(575): Drupal\\Core\\Form\\FormBuilder->doBuildForm('field_config_ed...', Array, Object(Drupal\\Core\\Form\\FormState))\n#8 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\\Core\\Form\\FormBuilder->processForm('field_config_ed...', Array, Object(Drupal\\Core\\Form\\FormState))\n#9 /var/www/docroot/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\\Core\\Form\\FormBuilder->buildForm(Object(Drupal\\field_ui\\Form\\FieldConfigEditForm), Object(Drupal\\Core\\Form\\FormState))\n#10 [internal function]: Drupal\\Core\\Controller\\FormController->getContentResult(Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\Core\\Routing\\RouteMatch))\n#11 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#12 /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#13 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#14 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#15 /var/www/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#16 /var/www/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#17 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#20 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#21 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#22 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#23 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#24 /var/www/docroot/core/lib/Drupal/Core/DrupalKernel.php(705): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#25 /var/www/docroot/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#26 {main}, referer: http://drupal.192.168.56.132.xip.io/admin/structure/paragraphs_type/social_list/fields/paragraph.social_list.field_test1/storage?destinations%5B0%5D%5Broute_name%5D=entity.field_config.paragraph_field_edit_form&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_config%5D=paragraph.social_list.field_test1&destinations%5B0%5D%5Broute_parameters%5D%5Bparagraphs_type%5D=social_list&destinations%5B1%5D%5Broute_name%5D=entity.paragraph.field_ui_fields&destinations%5B1%5D%5Broute_parameters%5D%5Bfield_config%5D=paragraph.social_list.field_test1&destinations%5B1%5D%5Broute_parameters%5D%5Bparagraphs_type%5D=social_list&destinations%5B2%5D=/admin/structure/paragraphs_type/social_list/fields/add-field
Comments
Comment #2
podarokhttps://www.drupal.org/project/plugin/issues/2647312#comment-13758380
Comment #3
podarokIn Open Y Fixed by adding rerolled patch https://github.com/ymcatwincities/openy/pull/2230
Comment #4
anpolimusThank you, Andrii.
My project has the same issue and patch helped.