As of this release, it's now possible to add the field to an entity in D11, but this warning shows up in the logs:

Warning: Undefined array key "description" in Drupal\field_ui\Form\FieldStorageAddForm->buildForm() (line 153 of /var/www/html/web/core/modules/field_ui/src/Form/FieldStorageAddForm.php)

Here's the backtrace:

#0 /var/www/html/web/core/includes/bootstrap.inc(104): _drupal_error_handler_real()
#1 /var/www/html/web/core/modules/field_ui/src/Form/FieldStorageAddForm.php(153): _drupal_error_handler()
#2 [internal function]: Drupal\field_ui\Form\FieldStorageAddForm->buildForm()
#3 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(554): call_user_func_array()
#4 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(303): Drupal\Core\Form\FormBuilder->retrieveForm()
#5 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#6 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#7 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#8 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(634): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}()
#9 [internal function]: Drupal\Core\Render\Renderer::{closure:Drupal\Core\Render\Renderer::executeInRenderContext():634}()
#10 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(635): Fiber->start()
#11 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#12 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#13 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}()
#14 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#15 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#16 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#17 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#18 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#19 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(118): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#20 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(92): Drupal\page_cache\StackMiddleware\PageCache->pass()
#21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#22 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#23 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(54): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#25 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(745): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#26 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#27 {main}

This example is from adding it to the User entity, so that users can have it.

Comments

colan created an issue. See original summary.

  • colan committed fab09269 on 4.x
    Issue #3579871 by colan: Declare a description on the sshkey_default...
colan’s picture

Version: 4.0.0-alpha3 » 4.x-dev
Status: Active » Fixed

The warning came from core's FieldStorageAddForm::buildForm() reading $option['description'] directly when grouping field types by category, while our #[FieldType] attribute didn't declare a description. Commit fab0926 adds a two-bullet description (matching the pattern core uses for, e.g., FileItem) so the option renders cleanly inside the category group instead of triggering the "Undefined array key" warning.

Coverage is locked in by a reflection-based unit test (testFieldTypeAttributeDeclaresDescription) so a future refactor can't silently strip the description and re-introduce the warning. The change is purely plugin metadata — no schema, storage, or runtime impact — so existing fields need no migration.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.