diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php index a639f30..634043b 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php @@ -234,7 +234,14 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac ); } - $name = $new_translation ? $GLOBALS['user']->getUsername() : user_load($entity->translation[$form_langcode]['uid'])->getUsername(); + // Default to the anonymous user. + $name = ''; + if ($new_translation) { + $name = $GLOBALS['user']->getUsername(); + } + elseif ($entity->translation[$form_langcode]['uid']) { + $name = user_load($entity->translation[$form_langcode]['uid'])->getUsername(); + } $form['content_translation']['name'] = array( '#type' => 'textfield', '#title' => t('Authored by'),