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.
I just committed a feature to CTools to allow the modal to trigger an event when it is closed, which should allow wysiwyg.module to respond to this and properly detach. The commit is here: http://drupal.org/cvs?commit=439216
A patch for wysiwyg is forthcoming, but I'm not sure if it's right. It works for my tests, but I am concerned that it will detach all wysiwyg editors rather than just the ones that were in the modal, so I'm not sure this is right. Still, I think this should be enough for someone who really understands wysiwyg to fix this up properly.
Patch forthcoming.
Comment | File | Size | Author |
---|---|---|---|
#18 | wysiwyg_ctools_detach-947676-18.patch | 407 bytes | zhangtaihao |
#9 | 0001-947676-by-merlinofchaos-6.x-2.x.patch | 875 bytes | mradcliffe |
#9 | 0001-947676-by-merlinofchaos-7.x-2.x.patch | 902 bytes | mradcliffe |
#9 | 0001-947676-by-merlinofchaos-7.x-aloha.patch | 872 bytes | mradcliffe |
#1 | 947676-wysiwyg-ctools-detach.patch | 764 bytes | merlinofchaos |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedComment #2
sunsubscribing
Comment #3
Cyberwolf CreditAttribution: Cyberwolf commentedSubscribing.
Comment #4
zilverdistel CreditAttribution: zilverdistel commentedsubscribing
Comment #5
jcfiala CreditAttribution: jcfiala commentedI'm having a related problem with Drupal Commons editing panels where we were seeing the error "Error: uncaught exception: [CKEDITOR.editor] The instance "edit-body" already exists."
So far, the patch that merlinofchaos gives here seems to be working for us.
Comment #6
TwoDHmm, yes that makes sense. Without the patch, the editor won't be properly detached when modals etc close, so its instance data will still exist when it's to be recreated later.
I'm just getting back to dealing with Wysiwyg issues and things have been piling up so it'll take a while before I can confirm this patch does the trick, but so far it seems good.
Comment #7
John Pitcairn CreditAttribution: John Pitcairn commentedsub
Comment #8
ailgm CreditAttribution: ailgm commentedThe patch works, to an extent, for us. The basic editor field appears and is usable. But now we're hitting a secondary issue ... the fields in pop-ups (e.g. image or link properties) aren't enterable. These secondary dialogs appear, and buttons like Browse work, but the text fields can't be typed into.
Any ideas?
Comment #9
mradcliffe#8 seems unrelated.
I ran into this issue in wysiwyg-7.x-2.x. The patch actually applies fairly cleanly, and works as intended.
I have re-rolled the patch for 6.x-2.x, 7.x-2.x, and 7.x-aloha. This seems like more of a bug report than a feature request.
Comment #10
weri CreditAttribution: weri commentedThe patch from #1 is working.
Comment #11
Kars-T CreditAttribution: Kars-T commentedCurrently I can't review every version but 7.x-2.x in #9 works for me.
Comment #12
Kars-T CreditAttribution: Kars-T commentedWell this patch works too good. If I open a ctools modal dialog with a ckeditor in it everything runs fine. But if I close the dialog any ckeditor that was on the page before the dialog is removed as well. I can get it back by clicking "deactivate richtext..." and than "activate richtext..." but this is not a great solution.
Please enhance the patch.
Comment #13
zhangtaihao CreditAttribution: zhangtaihao commented@Kars-T: It's highly likely the issue you're facing is being resolved at #356480: Lazy-load editors.
Comment #14
Kars-T CreditAttribution: Kars-T commentedI am aware of the issue and we are using the patch. Sadly this doesn't seem to fix the issue. If I open up my own ctools modale ckeditor would crash if I didn't add the patch. I will check this again but my last test did show I need both patches.
Comment #15
zhangtaihao CreditAttribution: zhangtaihao commentedYour observation is reflected in my update in #356480-168: Lazy-load editors.
Let's see if we can't RTBC the patches.
Comment #16
robcarrI've tried the combined patch at #356480-168: Lazy-load editors which includes the patch at #1 in this queue. Seems to address the modal window problem, as well as render WYSIWYG editors in custom pane windows. All seems fine with IPE too.
Link for combined patch: http://drupal.org/files/lazy_wysiwyg-356480-168-with-ctools.patch
Comment #17
Kars-T CreditAttribution: Kars-T commentedHi
the latest patch by merlin is in #9. And the statement "// Do we have to test to see if the instance is actually within the context?" is still true. Any editor on the load page will be closed not only the one in the modal popup.
Comment #18
zhangtaihao CreditAttribution: zhangtaihao commentedTechnically the logic should've worked, but the CToolsDetachBehaviors handler needs an "event" before "context".
This patch emulates how Drupal would've detached WYSIWYG.
Comment #19
zhangtaihao CreditAttribution: zhangtaihao commentedBased on #173, #179, & #180 from #356480: Lazy-load editors, marking this as RTBC.
Please change back if anyone disagrees.
Comment #20
Kars-T CreditAttribution: Kars-T commentedWorks like a charm!!! :D
zhangtaihao++
Comment #21
sunThanks for reporting, reviewing, and testing! Committed to 7.x-2.x.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #23
TwoDI have committed a backport of this patch to 6.x-2.x.