WSOD when creating a state field on Drupal 10.2

Created on 22 December 2023, 6 months ago
Updated 29 March 2024, 3 months ago

Problem/Motivation

The state field cannot be added to entities using the new Drupal 10.2 field creation form.

InvalidArgumentException: Field field_state is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 616 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get() (Line: 211)
Drupal\state_machine\Plugin\Field\FieldType\StateItem->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: 287)
Drupal\Core\Field\FieldItemList->defaultValuesForm() (Line: 230)
Drupal\field_ui\Form\FieldConfigEditForm->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: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 63)
Drupal\field_ui\Controller\FieldConfigAddController->fieldConfigAddConfigureForm()
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: 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)

Steps to reproduce

1. Go to /admin/structure/types/manage/page/fields/add-field
2. Input a name, choose the State type
3. Click continue
4. WSOD with above stack trace

Proposed resolution

Probably has something to do with this: https://www.drupal.org/node/3386675

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇭🇰Hong Kong phparkle

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

Comments & Activities

Production build 0.69.0 2024