summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-03-01 20:53:59 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2012-03-01 20:53:59 -0800
commit186437d33a903cd3ae13c7f1b2160a88941cc614 (patch)
tree08d493b620e62938419cf67a0554973a1866449a /modules/comment
parent824eb3cd6cb0ab7bd01531c7a1971b2d77ed8886 (diff)
downloadbrdo-186437d33a903cd3ae13c7f1b2160a88941cc614.tar.gz
brdo-186437d33a903cd3ae13c7f1b2160a88941cc614.tar.bz2
Issue #1058564 by Niklas Fiekas, droplet, grendzy, dixon_, naxoc: Fixed User picture does not appear in comment preview.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module1
-rw-r--r--modules/comment/comment.test10
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index b69b3b481..aa512a700 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -2064,6 +2064,7 @@ function comment_preview($comment) {
$comment->name = check_plain($account->name);
$comment->signature = $account->signature;
$comment->signature_format = $account->signature_format;
+ $comment->picture = $account->picture;
}
elseif (empty($comment->name)) {
$comment->name = variable_get('anonymous', t('Anonymous'));
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 723e5c4b9..3c85b12bd 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -956,15 +956,18 @@ class CommentPreviewTest extends CommentHelperCase {
$this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
$this->drupalLogout();
- // Login as web user and add a signature.
+ // Login as web user and add a signature and a user picture.
$this->drupalLogin($this->web_user);
variable_set('user_signatures', 1);
+ variable_set('user_pictures', 1);
$test_signature = $this->randomName();
$edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>';
$edit['signature[format]'] = 'filtered_html';
+ $image = current($this->drupalGetTestFiles('image'));
+ $edit['files[picture_upload]'] = drupal_realpath($image->uri);
$this->drupalPost('user/' . $this->web_user->uid . '/edit', $edit, t('Save'));
- // Fill in the comment form and preview the comment.
+ // As the web user, fill in the comment form and preview the comment.
$edit = array();
$edit['subject'] = $this->randomName(8);
$edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
@@ -981,6 +984,9 @@ class CommentPreviewTest extends CommentHelperCase {
// Check that the signature is displaying with the correct text format.
$this->assertLink($test_signature);
+
+ // Check that the user picture is displayed.
+ $this->assertFieldByXPath("//div[contains(@class, 'comment-preview')]//div[contains(@class, 'user-picture')]//img", NULL, 'User picture displayed.');
}
/**