Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Well I haven't fixed it but I made some progress. I made a method for ckeditor and it's getting called when "Add another item" is clicked. However the "[CKEDITOR.editor] The instance already exists" exception is still thrown so something is still missing. If someone else takes a stab at solving, hopefully this helps.
in place of mikeker's code. This will refresh the editor (and force the value to the html field) but also reload it after, whereas mikeker's code removes it completely.
Comments
Comment #1
Nick Robillard commentedAh I'd really like a fix for ckeditor too. :(
I'm going to start hacking around with wysiwygcck.js and try adding a Drupal.wysiwyg.editor.triggerSave for ckeditor.
Comment #2
Nick Robillard commentedWell I haven't fixed it but I made some progress. I made a method for ckeditor and it's getting called when "Add another item" is clicked. However the "[CKEDITOR.editor] The instance already exists" exception is still thrown so something is still missing. If someone else takes a stab at solving, hopefully this helps.
wysiwygcck.js (after line 14)
Comment #3
mikeker commentedI had luck by adding:
to wysiwygcck.js. (Put it just after the fckeditor line to keep things organized).
Patch coming soon...
Comment #4
mikeker commentedThis patch adds support for CKEditor version 3.0 and greater.
Note, my text editor removes trailing whitespace on save so there are a couple of extra "changes" that are just whitespace changes.
Comment #5
Syg commented#4
It does solve the problem of "add another" item for Ckeditor, but it generates another problem.
When you add for example a file/image upload field just before the wysiwyg one and upload an image all the wysiwygs in the page disappears.
I guess the condition triggering the detach function is not well set.
Comment #6
K.MacKenzie commentedFor anyone who is having this problem still, there is a simple solution that fixes AHAH issues for CKeditor.
just add (line 15 of wysiwygcck.js)
in place of mikeker's code. This will refresh the editor (and force the value to the html field) but also reload it after, whereas mikeker's code removes it completely.