- Issue created by @rkoller
If you are deleting a composite field and add a composite field on a content type the previously deleted composite field is still shown in the list of available options
/web/modules/custom/field_union
git clone git@git.drupal.org:issue/field_union-3011353.git .
git checkout field_union-3011353
ddev drush en field_union
one
on /admin/structure/field-union/add
with just one plain text fieldtwo
on /admin/structure/field-union/add
with just one plain text field composite
, delete the body
field, and create a new field, choose the composite field, and you will see the options one
and two
. /admin/structure/field-union
and delete one
and two
/admin/structure/types/manage/composite/fields
, create a new field, choose the composite /field union, => you will notice the deleted options are still shown
/admin/structure/field-union/add
and create a composite named three
with a plain text field/admin/structure/types/manage/composite/fields
, create a new field, choose the composite /field union,=> the only option shown is three
and if you delete the composite three
on /admin/structure/field-union
and then go back to /admin/structure/types/manage/composite/fields
and create a new field and you add a composite field and pick three
and go ahead this time the WSOD looks like this:
The website encountered an unexpected error. Try again later.
AssertionError: assert($union instanceof FieldUnionInterface) in assert() (line 183 of modules/custom/field_union/src/Plugin/Field/FieldType/FieldUnion.php).
Drupal\field_union\Plugin\Field\FieldType\FieldUnion::getFieldUnionEntityFromFieldDefinition() (Line: 39)
Drupal\field_union\Plugin\Field\FieldType\FieldUnion::propertyDefinitions() (Line: 794)
Drupal\field\Entity\FieldStorageConfig->getPropertyDefinitions() (Line: 65)
Drupal\Core\Field\TypedData\FieldItemDataDefinition->getPropertyDefinitions() (Line: 64)
Drupal\Core\Field\FieldItemBase->__construct() (Line: 47)
Drupal\Core\TypedData\TypedData::createInstance() (Line: 99)
Drupal\Core\TypedData\TypedDataManager->createInstance() (Line: 108)
Drupal\Core\TypedData\TypedDataManager->create() (Line: 208)
Drupal\Core\TypedData\TypedDataManager->getPropertyInstance() (Line: 91)
Drupal\Core\Field\FieldTypePluginManager->createFieldItem() (Line: 41)
Drupal\Core\Field\FieldItemList->createItem() (Line: 210)
Drupal\Core\TypedData\Plugin\DataType\ItemList->appendItem() (Line: 122)
Drupal\field_ui\Form\FieldStorageConfigEditForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm() (Line: 85)
Drupal\field_ui\Form\FieldStorageConfigEditForm->buildForm() (Line: 199)
Drupal\field_ui\Form\FieldConfigEditForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm()
call_user_func_array() (Line: 528)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 62)
Drupal\field_ui\Controller\FieldConfigAddController->fieldConfigAddConfigureForm()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 178)
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: 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: 705)
Drupal\Core\DrupalKernel->handle() (Line: 19)