Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It looks like the 6.x-2.x-dev branch of the wysiwyg drupal module can recognize version 2.8 of the yui library.
But version 2.8.0r4 has a weird failure mode: it appears to clear the entire textarea just before submitting a page.
This has the potential to be seriously damaging and frustrating! version 2.7.0b does not exhibit this problem.
Comment | File | Size | Author |
---|---|---|---|
#7 | wysiwyg-yui-detach.patch | 979 bytes | TwoD |
Comments
Comment #1
TwoDOops, didn't read the issue properly, ignore this post.
Comment #2
TwoDI'll look into this ASAP.
Comment #3
dkg CreditAttribution: dkg commentedthanks! I saw this behavior with iceweasel (firefox, unbranded) version 3.5.5
Comment #4
TwoDI just tested with FF 3.5.5 on Ubuntu Karmic. Seems to work just fine here. Detaching and re-attaching the editor using the rich-edit link works, as does submitting, preview and saving.
Can you please make sure you're not getting partially cached files or something left over when switching library versions?
Have you tried with the Garland theme?
If you are able, can you set breakpoints using Firebug or a similar tool and step though the detach call in the JS implementation of YUI to find out when the content is cleared?
If it still doesn't work, mind providing me with access to a sandbox environment where I can debug this?
Comment #5
gpk CreditAttribution: gpk commentedSame problem with same versions of wysiwyg module and yui editor (i.e. 6.x-2.x-dev (22 Nov 2009) of wysiwyg module and 2.8.0r4 of yui library).
On IE8 or Ff 3.0.16.
Same with custom theme or Garland theme.
There is a sort of clunky workaround: edit the page ad lib using the editor, then click the "disable rich-text" link, then hit Preview or Save, and the textarea is not then cleared immediately prior to submit.
Comment #6
gpk CreditAttribution: gpk commentedComment #7
TwoDI made a second test using IE8 on WinXP and now I do see this problem. I recalled an issue which said something about the destroy() method already calling saveHTML() but I can't find that issue now.
Removing the calls to saveHTML() did seem to do the trick at least in IE.
Comment #8
sunHm, this actually sounds similar to #667848: FCKeditor is not properly detached in IE
If this patch does not break other browsers, I'm fine with committing it to all branches.
In the long run, i.e. possibly for 3.x, we want to revisit the entire native event handling of all editors. Since Wysiwyg module already takes care of attaching/detaching/serializing values, it should probably make sure that there are no native event handlers of any editor attached to any element in the form.
Comment #9
TwoDYeah I was thinking the same thing, properly cleaning up after an editor is a bit tricky as many don't seem to expect to be disabled. But it shouldn't be impossible. The brute force way would simply be purging all event handlers for onSubmit etc, but I bet that would cause problems in other modules similar to what we experience with AJAXed fields. Ideally it should of course be done by getting references to the attached functions, like in that FCKeditor patch does.
No, the change above didn't create problems in other browsers I tested with.
Comment #10
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
...let's figure out where to put that @todo before this issue will be auto-closed ;)
Comment #11
jide CreditAttribution: jide commented@TwoD #7 : That was #614402: Plugin API support for YUI Editor comment #5.