diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 23:24:00 -0800 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-02-28 23:24:00 -0800 |
commit | 300a007c71b79692f5a48caeeba690b1eb3cefab (patch) | |
tree | 60d7b05e9e8831ef3440a6d3580e8765436c7486 /modules/comment | |
parent | 2a7d3d9b20eb80d011bf45ccc5376e57cdcbab12 (diff) | |
download | brdo-300a007c71b79692f5a48caeeba690b1eb3cefab.tar.gz brdo-300a007c71b79692f5a48caeeba690b1eb3cefab.tar.bz2 |
Issue #1267918 by Niklas Fiekas, darrellulm: Fixed User signature does not appear in comment preview.
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/comment/comment.test | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 2793ea3b5..b69b3b481 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2062,6 +2062,8 @@ function comment_preview($comment) { if (!empty($account->uid)) { $comment->uid = $account->uid; $comment->name = check_plain($account->name); + $comment->signature = $account->signature; + $comment->signature_format = $account->signature_format; } elseif (empty($comment->name)) { $comment->name = variable_get('anonymous', t('Anonymous')); diff --git a/modules/comment/comment.test b/modules/comment/comment.test index 970cc83ae..723e5c4b9 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -956,8 +956,15 @@ class CommentPreviewTest extends CommentHelperCase { $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.')); $this->drupalLogout(); - // As web user, fill in node creation form and preview node. + // Login as web user and add a signature. $this->drupalLogin($this->web_user); + variable_set('user_signatures', 1); + $test_signature = $this->randomName(); + $edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>'; + $edit['signature[format]'] = 'filtered_html'; + $this->drupalPost('user/' . $this->web_user->uid . '/edit', $edit, t('Save')); + + // 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); @@ -971,6 +978,9 @@ class CommentPreviewTest extends CommentHelperCase { // Check that the title and body fields are displayed with the correct values. $this->assertFieldByName('subject', $edit['subject'], t('Subject field displayed.')); $this->assertFieldByName('comment_body[' . $langcode . '][0][value]', $edit['comment_body[' . $langcode . '][0][value]'], t('Comment field displayed.')); + + // Check that the signature is displaying with the correct text format. + $this->assertLink($test_signature); } /** |