ERROR --> core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php

Created on 29 June 2025, 13 days ago

Getting this error when I try to view the display form (content type)

Structure --> Content Types --> Content Type -- > Manage Display

===========================
The website encountered an unexpected error. Try again later.

TypeError: Unsupported operand types: array + null in Drupal\field_ui\Form\EntityViewDisplayEditForm->{closure:Drupal\field_ui\Form\EntityViewDisplayEditForm::thirdPartySettingsForm():164}() (line 166 of core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php).

Drupal\Core\Extension\ModuleHandler->invokeAllWith('field_formatter_third_party_settings_form', Object) (Line: 162)
Drupal\field_ui\Form\EntityViewDisplayEditForm->thirdPartySettingsForm(Object, Object, Array, Object) (Line: 459)
Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow(Object, Array, Object) (Line: 41)
Drupal\field_ui\Form\EntityViewDisplayEditForm->buildFieldRow(Object, Array, Object) (Line: 213)
Drupal\field_ui\Form\EntityDisplayFormBase->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 528)
Drupal\Core\Form\FormBuilder->retrieveForm('entity_view_display_edit_form', Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 622)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 57)
Drupal\advban\AdvbanMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 715)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

=============================================================

This is what appears in error log on the hosting

[27-Jun-2025 16:06:22 Europe/London] Uncaught PHP Exception TypeError: "Unsupported operand types: array + null" at /home/DOMAIN/public_html/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php line 166

==========================================================

File Code

protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state) {
$settings_form = [];
// Invoke hook_field_formatter_third_party_settings_form(), keying resulting
// subforms by module name.
$this->moduleHandler->invokeAllWith(
'field_formatter_third_party_settings_form',
function (callable $hook, string $module) use (&$settings_form, &$plugin, &$field_definition, &$form, &$form_state) {
$settings_form[$module] = ($settings_form[$module] ?? []) + ($hook(
$plugin, /** <-- 166 */
$field_definition,
$this->entity->getMode(),
$form,
$form_state,
)) ?? []; /** <-- 171 has red x next to editor on hosting */
}
);
return $settings_form;
}

Removed Linked Field, and this disappears. installed and it appears

Drupal 11.2.2
PHP 8.4

🐛 Bug report
Status

Active

Version

1.7

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024