I am getting duplicated previewed text when previewing comments.
As an example the text editor gets the following in the comment_body
[quote=myaccount]
my comment is getting quoted twice
[/quote]
[quote=myaccount]
my comment is getting quoted twice
[/quote]
I added an not isset check on to quote_form_alter function to check if the comment_preview array isset as follows:
if (!isset($form['comment_preview'])) {
if (array_key_exists('#default_value', $form['comment_body'][$language][0])) {
// Add quoted text and preserve existing content (signature etc.).
$form['comment_body'][$language][0]['#default_value'] = $quote . $form['comment_body'][$language][0]['#default_value'];
}
else {
$form['comment_body'][$language][0]['value']['#default_value'] = $quote . $form['comment_body'][$language][0]['value']['#default_value'];
}
}
This seems to fix the problem for me and I know it is a duplicate of a previous issue on the version 6 of this module.
Also I tested the quote module on a test site and agree it does not exhibit this behavior when no other modules are installed but it is clearly an issue in a real world setup and as the patch is just an additional test if I provide the patch can this be committed?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | quote-duplicate_quoted_text_previewing_comment-1999642-1.patch | 1.47 KB | inventlogic |
Comments
Comment #1
inventlogic commentedpatch to add the comment_preview array check
Comment #2
Zen commentedI'm afraid that I'm not seeing this duplication upon hitting the preview button in beta2. Please provide steps to replicate.
Thanks.
Comment #3
ivnish