diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index 4555e8f..7b156de 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -110,7 +110,7 @@ public function form(array $form, array &$form_state) { if ($is_admin) { $author = $comment->name->value; $status = (isset($comment->status->value) ? $comment->status->value : COMMENT_NOT_PUBLISHED); - $date = (!empty($comment->date) ? $comment->date : DrupalDateTime::createFromTimestamp($comment->created->value)); + $date = (!empty($comment->date) ? $comment->date : (isset($comment->created->value) ? DrupalDateTime::createFromTimestamp($comment->created->value) : '')); if (empty($form_state['comment_preview'])) { $form['#title'] = $this->t('Edit comment %title', array( '%title' => $comment->subject->value, @@ -125,7 +125,7 @@ public function form(array $form, array &$form_state) { $author = ($comment->name->value ? $comment->name->value : ''); } $status = ($this->currentUser->hasPermission('skip comment approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED); - $date = ''; + $date = (!empty($comment->date) ? $comment->date : (isset($comment->created->value) ? DrupalDateTime::createFromTimestamp($comment->created->value) : '')); }  // Add the author name field depending on the current user.