array_intersect_key(): Argument #1 ($array) must be of type array, null given

Created on 17 May 2024, about 1 month ago
Updated 20 May 2024, about 1 month ago

Problem/Motivation

When you want to create a new base field but forget to click "view mode" (or you just need form mode only) the whole page crashes with error (+ unable to update already created base fields until this one is deleted) :

The website encountered an unexpected error. Try again later.

TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in array_intersect_key() (line 152 of core/lib/Drupal/Core/Field/WidgetPluginManager.php).

Drupal\Core\Field\WidgetPluginManager->prepareConfiguration() (Line: 357)
Drupal\Core\Entity\EntityDisplayBase->setComponent() (Line: 202)
Drupal\Core\Entity\EntityDisplayBase->init() (Line: 153)
Drupal\Core\Entity\EntityDisplayBase->__construct() (Line: 144)
Drupal\Core\Entity\Entity\EntityFormDisplay->__construct() (Line: 418)
Drupal\Core\Entity\EntityStorageBase->mapFromStorageRecords() (Line: 186)
Drupal\Core\Config\Entity\ConfigEntityStorage->doLoadMultiple() (Line: 312)
Drupal\Core\Entity\EntityStorageBase->loadMultiple() (Line: 262)
Drupal\Core\Entity\EntityStorageBase->load() (Line: 280)
Drupal\Core\Entity\EntityDisplayRepository->getFormDisplay() (Line: 355)
Drupal\Core\Field\FieldItemList->defaultValueWidget() (Line: 284)
Drupal\Core\Field\FieldItemList->defaultValuesForm() (Line: 97)
Drupal\easy_entity_field\Form\EasyEntityFieldForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024