Closed (duplicate)
Project:
Wysiwyg
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2010 at 10:17 UTC
Updated:
10 Oct 2012 at 17:09 UTC
I have installed latest version Wysiwyg module. I noticed after every submit there is always inserted <!--break-->. I have tried disabling TinyMCE (which i use with Wysiwyg) and this bug is still here.
I have search into code and i identify this lines of code:
/**
* Implementation of hook_form_alter().
*
* Before Drupal 7, there is no way to easily identify form fields that are
* input format enabled. As a workaround, we assign a form #after_build
* processing callback that is executed on all forms after they have been
* completely built, so form elements are in their effective order
* and position already.
*
* @see wysiwyg_process_form()
*/
function wysiwyg_form_alter(&$form, &$form_state) {
$form['#after_build'][] = 'wysiwyg_process_form';
// Teaser splitter is unconditionally removed and NOT supported.
if (isset($form['body_field'])) {
unset($form['body_field']['teaser_js']);
}
}
I try remove line with unset and now there is no problem. I think there is function in node.module which added this unwantend <!--break--> into text.
/**
* See if the user used JS to submit a teaser.
*/
function node_teaser_js(&$form, &$form_state) {
if (isset($form['#post']['teaser_js'])) {
// Glue the teaser to the body.
if (trim($form_state['values']['teaser_js'])) {
// Space the teaser from the body
$body = trim($form_state['values']['teaser_js']) ."\r\n<!--break-->\r\n". trim($form_state['values']['body']);
}
else {
// Empty teaser, no spaces.
$body = '<!--break-->'. $form_state['values']['body'];
}
// Pass updated body value on to preview/submit form processing.
form_set_value($form['body'], $body, $form_state);
// Pass updated body value back onto form for those cases
// in which the form is redisplayed.
$form['body']['#value'] = $body;
}
return $form;
}
Maybe I have some conflicting module or there is bug in Wysiwyg module? How can i resolve this? Thanks.
Comments
Comment #1
twodI might finally have found a way to reproduce this issue. Between work and other commitments I don't have time for this right now, but I hope to continue debugging later this week.
Comment #2
twodDuplicate of #862822: Breaks tag doubles, doesn't work.
Comment #3
drupalninja99 commented<!--break-->keeps getting added to the beginning of the body textarea every time the node gets saved.Comment #4
izarco commentedI have the same issue.