Argument #1 ($array) must be of type array when editing node

Created on 4 February 2024, 5 months ago
Updated 13 May 2024, about 1 month ago

Problem/Motivation

Hi,

When I updated my website from 9.5 to 10.2, I found myself unable to edit some contents, whether they're published or not.

I get the following error message :

The website encountered an unexpected error. Try again later.

TypeError: uasort(): Argument #1 ($array) must be of type array, null given in uasort() (line 65 of core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php).
Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getPluginId() (Line: 50)
Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getInstance() (Line: 101)
Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager->getSelectionHandler() (Line: 671)
Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem->getSettableOptions() (Line: 143)
Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase->getOptions() (Line: 34)
Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsSelectWidget->formElement() (Line: 448)
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 98)
Drupal\Core\Field\WidgetBase->form() (Line: 186)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form() (Line: 127)
Drupal\node\NodeForm->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() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->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)

Only some types of nodes have this problem, it seems it's those which can be created my any logged-in user, without special privileges, but I could be wrong.
These nodes have only a couple of text field, and a reference to commerce products, but other types of nodes with the same fields but that can only be created of edited by moderators work fine.

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Entity reference 

Last updated about 8 hours ago

No maintainer
Created by

🇫🇷France Shenron_segamag

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024