X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FField%2FPlugin%2FField%2FFieldWidget%2FEntityReferenceAutocompleteWidget.php;h=493d6a4f67475e0ec205106f0360109485b149b3;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=11f048e6f894d897f449aa8b0b1d0361010f7a6c;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php index 11f048e6f..493d6a4f6 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php @@ -107,7 +107,7 @@ class EntityReferenceAutocompleteWidget extends WidgetBase { if ($this->getSelectionHandlerSetting('auto_create') && ($bundle = $this->getAutocreateBundle())) { $element['#autocreate'] = [ 'bundle' => $bundle, - 'uid' => ($entity instanceof EntityOwnerInterface) ? $entity->getOwnerId() : \Drupal::currentUser()->id() + 'uid' => ($entity instanceof EntityOwnerInterface) ? $entity->getOwnerId() : \Drupal::currentUser()->id(), ]; } @@ -118,7 +118,7 @@ class EntityReferenceAutocompleteWidget extends WidgetBase { * {@inheritdoc} */ public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) { - return isset($element['target_id']) ? $element['target_id'] : FALSE; + return $element['target_id']; } /**