diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index 2f51a4c..27072ee 100644 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -87,9 +87,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen // Post-process the title field to make it conditionally required if URL is // non-empty. Omit the validation on the field edit form, since the field // settings cannot be saved otherwise. - // @todo - $is_field_edit_form = ($element['#entity'] === NULL); - if (!$is_field_edit_form && $this->getFieldSetting('title') == DRUPAL_REQUIRED) { + if (empty($form_state['default_value_widget']) && $this->getFieldSetting('title') == DRUPAL_REQUIRED) { $element['#element_validate'][] = array($this, 'validateTitle'); }