From 70d6b3360ee72a850bf86cc3cdae3ed59d857aea Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 9 Aug 2009 00:55:50 +0000 Subject: #524652 follow-up by tic2000 and yched: Fix comment preview bug and add tests. --- modules/comment/comment.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 6b54c4961..06f13dea1 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1882,10 +1882,10 @@ function comment_preview($comment) { $comment->format = $comment->comment_format; // Attach the user and time information. - if (!empty($edit['author'])) { - $account = user_load_by_name($edit['author']); + if (!empty($comment->author)) { + $account = user_load_by_name($comment->author); } - elseif ($user->uid && !isset($edit['is_anonymous'])) { + elseif ($user->uid && !isset($comment->is_anonymous)) { $account = $user; } @@ -1897,7 +1897,7 @@ function comment_preview($comment) { $comment->name = variable_get('anonymous', t('Anonymous')); } - $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : REQUEST_TIME; + $comment->timestamp = !empty($comment->timestamp) ? $comment->timestamp : REQUEST_TIME; $comment->in_preview = TRUE; $comment_build = comment_build($comment); $comment_build += array( -- cgit v1.2.3