Closed (duplicate)
Project:
Wysiwyg
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2011 at 11:24 UTC
Updated:
11 Jan 2014 at 10:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunThis can only be fixed for D7. Not sure whether this is a duplicate, no time to search right now.
Comment #2
Dean Reilly commentedUnderstood. Does anyone know if this is specific to CKEditor or whether all editors are affected? (Don't have the time to check right now but if no one responds by tomorrow I'll run through them all and take a look.)
Comment #3
sunThis affects all editors.
Comment #4
twodThe reason is simply that Wysiwyg currently runs the same code when syncing the editor's contents back to the original textarea on a form submit as it switching between editors (a call to the editor's
detach()method). We should perhaps add asave()orsync()method to the implementation layer?Comment #5
bryancasler commentedsubscribe
Comment #6
twodThis applies to all editors.
Comment #7
bryancasler commentedAny update on this?
Comment #8
twodNope, #4 still applies.
Note also that some editors may detach like this on purpose, to clean up event handlers and cross references between DOM objects and script objects so they won't cause memory leaks in certain browsers.
Comment #9
bryancasler commentedThanks for the down and dirty TwoD
Comment #10
tirdadc commentedAre there any work-arounds for this in the meantime?
I am applying this patch and I'm wondering if this issue is related to its use.
Comment #11
twodNo, there are no workarounds. We need to differentiate between what happens when switching between editors and when submitting the form for this visual annoyance to go away.
Comment #12
shady_gun commentedAny updates on this?? The editor disappears when you hit save button and when you try to embed media youtube http://drupal.org/project/media_youtube the raw source code is embedded instead of Video .
Edits
I tried with both tinyMCE and CKEeditor
Comment #13
shady_gun commentedComment #14
twodEditors disappearing is not a bug, the editors are detached/destroyed to sync the generated source code back to the original textarea - or nothing would be saved - and to prevent memory leaks from building up due to circular references between JavaScripts and DOM objects surviving page reloads.
This might not be necessary for all editors but it's the safest way to avoid potential browser crashes. Several of the more popular editors have built in cleanup routines that detect form submissions and destroy themselves for the very same reason.
It _might_ be possible to limit the visual effects of this, and allow editors that don't require full detachment to stay visible, by adding a new method to our editor API that'll just do the syncing part. It's something I've been thinking about adding to #614146: Drupal.wysiwyg.editor.instance needs additional methods but I haven't gotten that far yet. Hence, I'm turning this into a feature request for that just in case it doesn't get into the other issue.
I can't say exactly what happens with media_youtube.module since I haven't tried it, but if the video can actually be played when viewing the node, all is well.
Comment #15
twodWhoops.
Comment #16
shady_gun commentedThanks for the explanation and update Henrik ..
Comment #17
mitylite commentedNot satisfied with that explanation. I've never seen this on any website systems besides drupal. No forum i've ever used had this problem, so its clearly not an impossible task nor a necessary feature.
Looks absolutely unprofessional, which is something I've notice drupal has big issues with prior to D7... It's unfortunate this module has rationalized a reason to maintain that tradition in D7. Get rid of it. No mercy for it. Kill it.
Comment #18
AgaPe commented+
Comment #19
SlayJay commentedI agree 100% with #17... this makes drupal look sloppy.
Comment #20
nzcodarnoc commentedI guess it comes down to how you define a bug.
From a technical point of view it's clearly not a bug.
However, in my opinion it's a usability problem.
This opinion is based on the phone call I had with a client this morning, who though that the save button had to be clicked twice.
She formed this impression because, in her mind, when the WYSIWYG editors disappeared, she was on a new page.
That is to say, that her interpretation of a "new page", is when there is a significant change in the appearance of the page.
So she clicked save again, and was informed her changes couldn't be saved. Only to discover that her changes had been saved.
Granted, we are working on a slow staging server, so it's likely to be less of a problem when live.
For all of these reasons I think this is a usability issue serious enough to be called a bug.
My current thinking is that I will bind something to the save button that puts a transparent matte over the whole page as it saves.
Comment #21
bryancasler commentednzcodarnoc, I'd be interested in the transparent matte solution for the interim. Please keep us informed. You may also want to look at this module, I haven't yet tested the D7 dev release. http://drupal.org/project/hide_submit
Comment #22
nzcodarnoc commentedNote: the site I'm working on is Drupal 6
I've implemented this leveraging the matte in Lightbox2, so you will need to have Lightbox2 installed for this to work.
First of all I created a custom module and put the following in hook_form
Then in the modulename folder I add the file modal-saving.js
Comment #23
adr_p commentedI've prepared a simple patch which causes WYSIWYG to fill original textarea instead of detaching the editor when the form is submitted. I've tested it only with CKEditor. Also, there can be consequences of using this solution, TwoD wrote about those earlier. Prior to applying the patch you must apply the one attached here: http://drupal.org/node/614146#comment-5667126.
Please don't hesitate to post comments.
Comment #24
twod@adr_p, I would not recommend that approach. It's simple, but will leave the editor instance in memory. That may lead to errors saying the editor instance already exists if the form doesn't actually complete the submission (AJAX).
We've been working on fixing the AJAX problem in #1388224: editors detach on AJAX form submission, and that could be generalized to leave only the visual elements of the editor intact for normal submits as well. That patch does not need the patch in #614146-41: Drupal.wysiwyg.editor.instance needs additional methods, but works together with it if you need it for some other reason.
I'm going to commit that patch soon, but ran into a few issues while trying to backport it to D6.
Comment #25
Ivat commentedI run into the same problem using Wysiwyg 7.x-2.1 width CKEditor 3.6.3.7474
Is there any temporary fix to this issue?
Thanks in advance.
Comment #26
twodTry Wysiwyg 7.x-2.x-dev. I've committed a patch from #1388224: editors detach on AJAX form submission to the D7 branch. Once that patch was in, a single line change in it should have fixed this issue as well so I put it in there.
It does not seem possible to directly port that patch back to the D6/5 branches since it depends on some changes made to D7 core, but perhaps we can at least port the portion of that patch which will fix the issue discussed here for D6/5 as well.
I'll take a look at that if I get some free time during the weekend.
Comment #27
adr_p commented@TwoD
I see your point in #24, but there are many other ways (than hitting submit) user can leave a page containing editor, e.g. by following a link. Wouldn't it cause the problem you've described?
Comment #28
Ivat commentedThanks TwoD ! This version works fine : 7.x-2.x-dev (2012-Jul-08).
Comment #29
twodI'm closing this as a duplicate of #1388224: editors detach on AJAX form submission, which was commited long ago.
Editors which support updating the original textarea without detaching completely (most of them) now do so, and only perform the amount of cleanup needed to avoid [known] memory leaks.
Navigating away from a page with a link is usually handled by an editor using the document's onunload event, and it will perform the necessary cleanup on its own.