diff -u b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php --- b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -472,7 +472,7 @@ * {@inheritdoc} */ public function getAuthorId() { - return $this->get('uid')->value; + return $this->get('uid')->target_id; } /** diff -u b/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php --- b/core/modules/file/lib/Drupal/file/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Entity/File.php @@ -128,7 +128,7 @@ * {@inheritdoc} */ public function getAuthorId() { - return $this->get('uid')->value; + return $this->get('uid')->target_id; } /** diff -u b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php --- b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php @@ -160,7 +160,7 @@ * {@inheritdoc} */ public function getAuthorId() { - return $this->get('user_id')->value; + return $this->get('user_id')->target_id; } /**