Closed balajijana closed 6 years ago
Hello @balajijana could you please share us with a sample where we can take a look at the reported issue ( e.g. using https://jsfiddle.net/) or provide to us CKEditor package and your Html page.
Yes please see the attached console error.
@balajijana Thank you for provided info, but could you please emulate ur problem using https://jsfiddle.net/ or provide us your CKEditor with our SCAYT plugin.
Also please describe vendor.min.js - ZoneTask.invoke workflow
Since there is no response and details provided for about 4 months – we mark this issue as closed.
I have a similar issue, and am able to reproduce the problem (see attached project).
To reproduce: 1) Open "home.html" 2) Open developer tools and open console tab 3) Click "Edit Text" button 4) Modal will open with CKEditor containing text, click "Close" button. 5) Click "Edit Text" button again See: Modal opens with CKEditor containing text, and "Uncaught Error: Error in Rangy WrappedRange module: createRange(): Parameter must be a Window object or DOM node" error in console.
Note: In the javascript when the modal opens it replaces the content of the modal (this would be done via ajax in our actual system).
Hello @wiggydave10,
Thank you for describing steps and providing your sample. With this information we were able to reproduce the mentioned problem. We have added this problem to our backlog for investigation. As soon as we have the fix, we will include it to one of our releases. We will keep you posted.
Sincerely,
to solve this problem I call function hereafter before opening new edit form:
function ckeditordestroy(){ if (CKEDITOR.instances.postcontent){ CKEDITOR.instances.postcontent.destroy(); } }
@officinalab sadly this doesn't seem to work. It still generates the same error message. Looks like postcontent is always undefined. I've tried using the editor id instead of the postcontent (maybe I was meant to, but just being stupid), however, I get different errors instead (see below)
Uncaught TypeError: Cannot convert object to primitive value and Uncaught TypeError: Cannot read property 'document' of null
In my case is postcontent but you must use the name defined with:
CKEDITOR.replace( 'postcontent', {});
The problem is done that you have already an instance of ckeditor in use, please see doc: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#destroy
@officinalab so I have an editor which I replace with CKEDITOR.replace( 'mainEditor'
so I have added the destroy function using CKEDITOR.instances.mainEditor.destroy()
, however, I get the 2 previous errors.
Uncaught TypeError: Cannot convert object to primitive value and Uncaught TypeError: Cannot read property 'document' of null
Have you been able to fix it on my example? If so how did you do it?
@officinalab apologies. I was being stupid. I thought the destroy was being called before the content got replaced, but it wasn't. Seems to have done the trick. Thanks for your help.
Welcome! I updated your example here: ck.zip
Hi @wiggydave10,
The suggestion from @officinalab is correct. You should call the destroy before the element replace.
@officinalab, thanks for your help.
Best Regards,
Don't mention it! @wsc-julia-shaptala
Hi Support,
I am using scayt in the ckeditor as external plugin. I am able to add and save the new content. when i try to edit and save the content i am getting the following error : Uncaught Error: Error in Rangy WrappedRange module: createRange(): Parameter must be a Window object or DOM node. Please let me know how the issue can be rectified?