diff --git a/core/modules/field_ui/src/Form/FieldStorageAddForm.php b/core/modules/field_ui/src/Form/FieldStorageAddForm.php index 3b38e2e..9d9786c 100644 --- a/core/modules/field_ui/src/Form/FieldStorageAddForm.php +++ b/core/modules/field_ui/src/Form/FieldStorageAddForm.php @@ -149,11 +149,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t // Show the field description, if it exists. $form['description_wrapper'] = [ '#type' => 'container', - '#states' => [ - '!visible' => [ - ':input[name="new_storage_type"]' => ['value' => ''], - ], - ], ]; foreach ($ui_definitions as $category => $field_types) { foreach ($field_types as $name => $field_type) { @@ -161,16 +156,14 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t continue; } $form['description_wrapper']["description_{$name}"] = [ - '#type' => 'container', + '#type' => 'item', + '#markup' => $field_type['description'], '#states' => [ 'visible' => [ ':input[name="new_storage_type"]' => ['value' => $name], ], ], ]; - $form['description_wrapper']["description_{$name}"]['description'] = [ - '#markup' => $field_type['description'], - ]; } } diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/UiDescriptionsTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/UiDescriptionsTest.php index 806c9bd..0e0c9b3 100644 --- a/core/modules/field_ui/tests/src/FunctionalJavascript/UiDescriptionsTest.php +++ b/core/modules/field_ui/tests/src/FunctionalJavascript/UiDescriptionsTest.php @@ -35,6 +35,11 @@ protected function setUp() { /** * Tests the descriptions of some fields. + * + * @todo Move this test to + * \Drupal\field_ui\Tests\ManageFieldsTest::testPreconfiguredFields() when + * it is converted to a functional test. + * @see https://www.drupal.org/project/drupal/issues/2794347 */ public function testFieldDescriptions() { $page = $this->getSession()->getPage();