diff --git a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php index 720d0a6..68a498c 100644 --- a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php +++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php @@ -36,6 +36,7 @@ class LinkItem extends FieldItemBase implements LinkItemInterface { public static function defaultFieldSettings() { return array( 'title' => DRUPAL_OPTIONAL, + 'description' => DRUPAL_OPTIONAL, 'link_type' => LinkItemInterface::LINK_GENERIC ) + parent::defaultFieldSettings(); } diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index 915f696..f668ab1 100644 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -87,6 +87,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen '#title' => $this->t('Link description'), '#default_value' => isset($items[$delta]->description) ? $items[$delta]->description : NULL, '#maxlength' => 255, + '#access' => $this->getFieldSetting('description') != DRUPAL_DISABLED, ); // Post-process the title field to make it conditionally required if URL is