Deleting field on content type w/o paragraphs field causes WSOD

Created on 8 July 2025, 1 day ago

Problem/Motivation

On a site I'm helping with, when a field is deleted on a content type (or entity type) that doesn't have a paragraphs field, the following error is thrown:

InvalidArgumentException: Field layout_builder__layout is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 616 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

The full backtrace is as follows:

  • Drupal\Core\Entity\ContentEntityBase->get() (Line: 657)
  • Drupal\Core\Entity\ContentEntityBase->set() (Line: 65)
  • Drupal\layout_builder\Field\LayoutSectionItemList->getEntity() (Line: 561)
  • Drupal\Core\Entity\ContentEntityStorageBase->purgeFieldData() (Line: 82)
  • field_purge_batch() (Line: 123)
  • Drupal\field_ui\Form\FieldConfigDeleteForm->submitForm()
  • call_user_func_array() (Line: 105)
  • Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 43)
  • Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 589)
  • Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
  • Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
  • Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
  • Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult() (Line: 95)
  • Drupal\mercury_editor\Controller\MercuryEditorHtmlEntityFormController->getContentResult()
  • call_user_func_array() (Line: 123)
  • Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
  • Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
  • Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
  • Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
  • Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
  • Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
  • 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: 116)
  • Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
  • 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: 38)
  • Drupal\mercury_editor\StackMiddleware\AjaxPageState->handle() (Line: 51)
  • Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
  • Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Enable Mercury Editor for a content type.
On a different content type, delete a field.

Expected behavior:
* The field is deleted as normal.

Actual behavior:
* An error is thrown.

Proposed resolution

Fix the bug.

Remaining tasks

Fix the bug.

User interface changes

TBD

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Active

Version

2.2

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States damienmckenna NH, USA

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

Comments & Activities

Production build 0.71.5 2024