Closed (fixed)
Project:
CKEditor for WYSIWYG Module
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2013 at 05:15 UTC
Updated:
6 Sep 2013 at 21:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
kingman1016 commentedYes, it also disappears when adding multi value field items.
Comment #2
andraek commentedI'm guessing then that it must have something to do with the editor not being re-enabled after the form is updated via ajax?
Comment #3
swati.karande commentedHi,
I have attached a small patch for this issue.
Comment #4
andraek commentedYou are awesome! Thank you!
Comment #5
markabur commentedHm, so WYSIWYG module itself needs to be patched in order to fix this issue? The patch does work, but it seems like CKEditor for WYSIWYG Module is the one with the problem?
Comment #6
paulmicha commentedPatch in #3 works, thanks a lot !
(Moving this issue in wysiwyg project).
Comment #7
twodI'm not seeing this issue, the editor doesn't actually get removed on 'serialize' events because those are supposed to enable syncing of contents back to the original textarea (so AJAX operations can serialize up to date form values etc) when other elements in the same form are about to be replaced as a response to an AJAX operation or other DOM manipulations. Thus, the editor should not get replaced in the first place if '#wrapper' was set correctly on the image upload field so it only targets a wrapper of the image field itself.
When I upload an image using the core Image field, the
detach()integration method gets called for all instances withtrigger='serialize'and thus calls theupdateElement()method on the CKEditor instance.It never calls the
destroy()method on any CKEditor instance unless one of the fields which are actually about to be replaced have editor instances on them. Then the instance must be destroyed so it can be recreated on the original textarea which has now been replaced, or you'll get errors about the instance already existing.The patch won't apply because there are whitespace errors and it's not been created from inside the Wysiwyg folder.
Specifically mentioning Image module in the comment isn't very helpful since any module can tell Drupal to detach behaviors using the 'serialize' trigger at any time.
How did you come up with the patch? What's the reasoning behind not calling detach() when trigger is 'serialize'?
Comment #8
markabur commented@TwoD I've only seen this issue with http://drupal.org/project/wysiwyg_ckeditor -- not the normal ckeditor component that is included with Wysiwyg module.
Comment #9
twodOh, that makes sense then since wysiwyg_ckeditor doesn't currently check the reason for the detach call and always destroys the editor instance.
http://drupalcode.org/project/wysiwyg_ckeditor.git/blob/refs/heads/7.x-1...
vs
http://drupalcode.org/project/wysiwyg.git/blob/refs/heads/7.x-2.x:/edito...
Comment #10
paulmicha commentedSo if i'm guessing correctly, the proper fix for this issue should be :
Comment #11
swati.karande commentedIt looks correct and working for me.
Thanks!
Comment #12
rv0 commentedpatch works for me
Comment #13
paulmicha commentedComment #14
davidneedhamI can also confirm that the patch in #10 worked for me.
Comment #15
quicksketchThanks @Paulmicha! And all testers. Committed.