Opened 5 years ago

Closed 4 years ago

#12482 closed Bug (expired)

Uncaught TypeError: Cannot read property 'clearCustomData' of null in Chrome

Reported by: Jeff Steil Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

After opening an instance of ckeditor in an ajax rendered window, the next time it opens I want to destroy the existing instance but in Chrome it is throwing an exception - "Cannot read property 'clearCustomData' of null in Chrome". I was able to fix this in the minified version of ckeditor.js by adding the if logic I detailed here: http://stackoverflow.com/questions/25034150/ck-editor-uncaught-typeerror-cannot-read-property-clearcustomdata-of-null-i/26022306#26022306

Basically clearCustomData is being called an object that is null, I just added if statements to check if the object exists before calling clearCustomData.

Attachments (1)

ckeditor.js (513.0 KB) - added by Jeff Steil 5 years ago.
modified ckeditor.js (minified)

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by Jeff Steil

Attachment: ckeditor.js added

modified ckeditor.js (minified)

comment:1 Changed 5 years ago by Jakub Ś

Status: newpending
Version: 4.4.4

It doesn't look like a solution to me but way to hide the real problem.

  1. Could you send us reduced and working code sample that will show this problem? I'm talking about HTML file (with js, css if needed) that can be put in samples folder and will show this issue.
  2. What code you use for your editor? Is it the same as in stackoverflow?
    var editor = CKEDITOR.instances['Description'];
    if (editor) { editor.destroy(true); }
    CKEDITOR.replaceAll();
    

If that is the case you could replace it with

var editor = CKEDITOR.instances['Description'];
if (editor) { editor.destroy(true); }
CKEDITOR.on('instanceDestroyed', function(evt){
CKEDITOR.replace('someId');
});

Could you tell me if it has worked for you?

One final question. Why destroying one editor and then create editor on all possible textareas with CKEDITOR.replaceAll(); method? The replace method should be used instead.

comment:2 Changed 5 years ago by Jeff Steil

Yes, completely agree. I just needed a quick fix so that is what I came up with. I will walk through your suggestions and if they don't fix the issue will attach a working code sample.

comment:3 Changed 4 years ago by Jakub Ś

Resolution: expired
Status: pendingclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy