Initial situation
- CKeditor module 7.x-1.13
- CKeditor 4.1
- Panels 7.x-3.3
- Browser: I have used Chrome and Firefox (newest versions)
Problem
If I add in a panel new content ("New custom content") the CKEditor appears for the first time. If I close the panels window and open it again, only the textarea (with no CKEditor) appears. I get in Chrome the javascript error: "Uncaught TypeError: Cannot call method 'clearCustomData' of null". But the error occurs in no particular file or line.
If I reload the complete site, the editor appears again for the first time.
In the issue queue of WoltLab a similar problem (with the same error message) was posted: https://github.com/WoltLab/com.woltlab.wcf.user/issues/153
Maybe it helps to identify the specific error.
Comment | File | Size | Author |
---|---|---|---|
#6 | ckeditor_panels_bug_1.png | 15.15 KB | globexplorer |
#6 | ckeditor_panels_bug_2.png | 36.63 KB | globexplorer |
#6 | ckeditor_panels_bug_3.png | 19.29 KB | globexplorer |
#6 | ckeditor_panels_bug_4.png | 11.78 KB | globexplorer |
#3 | ckeditor-1990224-2.patch | 537 bytes | k0teg |
Comments
Comment #1
cbeier CreditAttribution: cbeier commentedDamn.
Comment #2
caspervoogt CreditAttribution: caspervoogt commentedsame here. Tried with 7.x-1.13 as well as the latest dev release. Actually, also tried with CK Editor 3.6 before that.
Funny thing is that this had been working, but I recently updated to Drupal 7.21. I have JS aggregation off, cleared caches, etc.
It also seems to happen only on certain textareas (even when I rearrange their order), and on blocks. There is nothing special or different about these textareas or the content they contain.. I tried using just very simple HTML - no difference.
Comment #3
k0teg CreditAttribution: k0teg commentedHi,
Try to use this patch.
Comment #4
jcisio CreditAttribution: jcisio commentedSimilar to #1967990: "Uncaught TypeError: Cannot read property 'document' of null" error when edit custom content pane twice, but the JS error is different.
Comment #5
bnash2501 CreditAttribution: bnash2501 commented@k0teg this patch worked for me, thanks.
Also applied the patch from the issue jcisio linked which fixed another problem.
Comment #6
globexplorer CreditAttribution: globexplorer commentedI've installed the patch and ckeditor disappears again.
What happens exactly: The first click on the configure ipe button on a fieldable panels pane loads the ctools modal with ckeditor. Then I click save. I reopen the pane with a click on the ipe configure button again, and the ckeditor disappears. The third time I clicked on the ipe configure button, the loading time of the pane dramatically increases.
I hope the attached screenshots help to reproduce the issue.
Installed Versions:
Drupal 7.22
Chaos tools 7.x-1.3
Panels 7.x.-3.3
Panelizer 7.x.-3.1
Panels In-Place Editor 7.x.-3.3
Fieldable Panels Pnae 7.x.-4.4
Ckeditor 7.x-1.13 / Ckeditor library version (CKEditor 3.6.6)
Media Asset 7.x-1.0-beta4
Comment #7
caspervoogt CreditAttribution: caspervoogt commentedSorry, I have not had occasion to use the patch; I had to get the editor working ASAP so I switched to the WYSIWYG module instead :(
Comment #8
globexplorer CreditAttribution: globexplorer commentedand wysiwyg and ckeditor works fine?
Comment #9
dubcanada CreditAttribution: dubcanada commentedThe problem seems to be that Panels is trying to "destroy" the ckeditor if any exist on load. While the first time this is obviously not going to happen as none exist. However on subsequent loads when a ckeditor does exist, it tries to destroy it. However since the modal removes the ckeditor from the DOM. The CKEditor dies on the (iframe.clearCustomData) any all subsequent calls to iframe in the wysiwygarea.js plugin.
I created a issue with ckeditor https://dev.ckeditor.com/ticket/10717 but the real issue is that CKEditor instances should be removed on modal close, not on modal open.
Comment #10
dubcanada CreditAttribution: dubcanada commentedI also can confirm that the WYSIWYG module does work fine.
The patch posted above does not work, it solves half the problem (destroying the CKEditor) it however skips the clearCustomData which causes the IPE to load the same content on subsequent loads of the CKEditor.
Comment #11
pingwin4egConfirm the same behavior with Colorbox project: when the CKEditor is inside the Colorbox modal window.
A solution like in #1967990-6: "Uncaught TypeError: Cannot read property 'document' of null" error when edit custom content pane twice helped. Here is the code:
The main problem in my opinion is that
CKEDITOR.instances
still stores textarea id after a window has been closed.Comment #12
KroKroDile CreditAttribution: KroKroDile commentedwith the dev version of ckeditor module, this js error disapears.
Comment #13
sjhuskey CreditAttribution: sjhuskey commented#12 worked for me. I hope that the new release will be available soon.
Comment #13.0
sjhuskey CreditAttribution: sjhuskey commentedCorrect version number.
Comment #14
joelstein CreditAttribution: joelstein commentedSame here... when upgrading to latest dev snapshot, the error doesn't re-appear, and CKEditor loads each time I open up the Panels modal.
Comment #15
wwalc CreditAttribution: wwalc commentedAll the recent comments suggest that the issue is gone in the latest dev version of CKEditor module, so I'm closing this. If anyone still encounter a similar problem, please reopen this ticket and provide as much details as possible.
Comment #16
grasmash CreditAttribution: grasmash commentedI am still experiencing this bug on the latest version of 7.x-1.x-dev, and the patch does appear to fix it.
Comment #17
grasmash CreditAttribution: grasmash commentedComment #18
grasmash CreditAttribution: grasmash commentedAfter some more testing, I've found that this patch introduces a bug with the rich-text toggle for CKEditor.
Comment #19
wwalc CreditAttribution: wwalc commented@grasmash - could you provide more details? Is there any JavaScript exception in the JS console - if yes, could you paste all the available information? Does it happen in every browser? What version of panels are you using, which theme? Do you have any other non-standard setup that could potentially cause this?
Comment #20
grasmash CreditAttribution: grasmash commented@wwalc
Tested in Chrome. Using panels 7.x-3.4.
I'll try to gather more information.
Comment #21
garbo CreditAttribution: garbo commentedThe patch at #6 by XVENDO works for me. Now the CKEditor shows in Ctools modal popups (media upload edit popup).
Cheers,
Bram.