diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index e5e636b..7b8726b 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1690,7 +1690,6 @@ function comment_form($form, &$form_state, $comment) { if ($is_admin) { $author = (!$comment->uid && $comment->name ? $comment->name : $comment->registered_name); $status = (isset($comment->status) ? $comment->status : COMMENT_NOT_PUBLISHED); - $date = (!empty($comment->date) ? $comment->date : format_date($comment->created, 'custom', 'Y-m-d H:i O')); } else { if ($user->uid) { @@ -1700,7 +1699,11 @@ function comment_form($form, &$form_state, $comment) { $author = ($comment->name ? $comment->name : ''); } $status = (user_access('skip comment approval') ? COMMENT_PUBLISHED : COMMENT_NOT_PUBLISHED); - $date = ''; + } + + $date = ''; + if(!empty($comment->cid)) { + $date = (!empty($comment->date) ? $comment->date : format_date($comment->created, 'custom', 'Y-m-d H:i:s O')); } // Add the author name field depending on the current user. diff --git a/core/modules/comment/comment.test b/core/modules/comment/comment.test index 2771bc4..be28726 100644 --- a/core/modules/comment/comment.test +++ b/core/modules/comment/comment.test @@ -892,7 +892,7 @@ class CommentPreviewTest extends CommentHelperCase { $edit['date'] = '2008-03-02 17:23 +0300'; $raw_date = strtotime($edit['date']); $expected_text_date = format_date($raw_date); - $expected_form_date = format_date($raw_date, 'custom', 'Y-m-d H:i O'); + $expected_form_date = format_date($raw_date, 'custom', 'Y-m-d H:i:s O'); $comment = $this->postComment($this->node, $edit['subject'], $edit['comment_body[' . $langcode . '][0][value]'], TRUE); $this->drupalPost('comment/' . $comment->id . '/edit', $edit, t('Preview'));