diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index 8b24aba..7563271 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -248,6 +248,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setDescription(t('The user ID of the comment author.'))
       ->setTranslatable(TRUE)
       ->setSetting('target_type', 'user')
+      ->setDefaultValueCallback('Drupal\comment\Entity\Comment::getCurrentUserId')
       ->setDefaultValue(0);
 
     $fields['name'] = BaseFieldDefinition::create('string')
@@ -569,4 +570,16 @@ public function getTypeId() {
     return $this->bundle();
   }
 
+  /**
+   * Default value callback for 'uid' base field definition.
+   *
+   * @see ::baseFieldDefinitions()
+   *
+   * @return array
+   *   An array of default values.
+   */
+  public static function getCurrentUserId() {
+    return array(\Drupal::currentUser()->id());
+  }
+
 }
