I have noticed a situation where unless TinyMCE is the default editor upon the page load, it's not saving the content.
Here is the situation:
I'm using NicEdit 0.9 as the default editor within the Filtered HTML input format selection. When a page first loads using this input format and editor, everything works fine when I save the drupal node. However, if I switch the input format to Tiny MCE and then save the drupal node, the content controlled by Tiny MCE does not get saved. In fact, it gets reverted to just "
".
Now, if I make the Full HTML input format selection default (which uses Tiny MCE as the default editor) then everything works fine ASSUMING I don't change the input format at all (even if I go from Tiny MCE to something else and back to Tiny MCE).
So it seems switching from any editor to Tiny MCE will cause it to fail saving the content.
Keep in mind, this is ONLY when changing the input format. If Tiny MCE is the editor that loads upon the initial page load, it works fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nicedit.js-1084248.patch | 299 bytes | tacituseu |
Comments
Comment #1
twodDo you see any JavaScript errors when switching back and forth between formats or when clicking "Enable/Disable rich-text"?
If you type something into TinyMCE and click "Disable rich-text" instead of submitting the form, does the source code look alright and up to date with the changes made in the editor?
Comment #2
jazzdrive3 commentedI'm having this same problem. Things seemed to be working fine.
When it's basic content everything works fine. The problem comes when adding image tags. It seems adding to many of them is overloading it? If I add one image tag at a time and save between them, it seems to work fine. Strange.
Comment #3
hydrian commentedMake sure that your 'Input Format' definition allows all of the tags that your TinyMCE (or any other WYSIWYG editor) is generating. I know the <p> tag is used in almost all of them, but it is not part of any of the default Input Format definitions. This will cause drupal to strip any thing between those tags.
Comment #4
hydrian commentedWhat version of TinyMCE are you running? I'm running 3.4.2. I'm having a similar problem. I fixed some of my issue by correcting the drupal core input filters. It seems that there is more to this though.
After doing some testing, I noticed that each time I enabled/disable rich-text, a new <input type="hidden" name="edit-body"> in being injected into the DOM. I would think these should have been overwritten not appended to. It looks like every time TinyMCE loads, it gets its data from the element that is named 'edit-body'. Since HTTP post/get only reads the first HTML input element of of a specified name, the other instances of this hidden input are ignored. This makes TinyMCE come up blank.
Recreation steps:
Comment #5
tacituseu commentedHad same problem with CKEditor 3.5 for Full HTML and nicEdit 0.9 as default/Filtered HTML, the source of the problem is inside nicEdit.js (lib):
it registers onsubmit handler for form element, which will restore textarea's content to last one entered into nicEdit before disabling it/switching from it:
A 'needs work' (only Chrome tested) patch attached.
Comment #6
udane commentedI have the same problem. I am using wysiwys 6.x-2.2 and tinymce 3.3.9.
First of all, when I enter to edit a node, the default filter is always FilteredHtml, although I save it in full html or anyone else. Then, when I disable rich text, all img tags are stripped, although FilteredHtml supports img tags.
Is there any solution?
Thanks!
Comment #7
twod@hydrian, yes, the editor will get the contents from the field named 'edit-body' since that's what Wysiwyg tells it do do. But those hidden input elements should not exist at all. I'm not sure why they are there or what creates them, but you should only see a textarea with the name 'edit-body'. Unless some module is manipulating the form... TinyMCE has no support for hidden input fields.
@tacituseu, This issue is for TinyMCE, if you're having similar problems with other editors please create new issues. If it happens with all of them somehting's most likely wrong with Wysiwyg itself, so one issue is enough. I'd consider the nicEdit problem a bug in nicEdit itself, as it'll happen regardless of whether Wysiwyg is used or not. The submit event handler should be removed so that nicEdit isn't invoked at all when the form is submitted and it's not active. We already do the same thing for a few other editors that don't have an official API call for removing the editor so even if this editor should be able to take care of it on its own, we can add that. Let's create a specific issue for that though.
@udane, Input format settings will not affect the editor's behavior. Input formats are only applied during rendering of the finished node.
Can you check if the browsers show any JavaScript errors? If there is an error when TinyMCE is detached it can not write the contents back to the original textarea.
Comment #8
tacituseu commentedDidn't mean to hijack, just had exactly the same problem with different editor for Full HTML, and hoped that OP can confirm with the patch attached that it is indeed nicEdit's fault and just change title/component.
Update: Issue for nicEdit #1132142: nicEdit doesn't remove its submit event handler
Comment #9
sunSorry, without further information this issue can only be closed as not reproducible.
Feel free to re-open this issue if you want to provide further information. Thanks.