Skip to content
Snippets Groups Projects
Commit 35b0b2ce authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1058564 by Niklas Fiekas, droplet, grendzy, dixon_, naxoc: Fixed User...

Issue #1058564 by Niklas Fiekas, droplet, grendzy, dixon_, naxoc: Fixed User picture does not appear in comment preview.
parent 023ad507
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1911,6 +1911,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'));
......
......@@ -975,15 +975,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);
......@@ -1000,6 +1003,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.');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment