Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

this.getDoc() is null in FF using tinymce

I got the problem that when i load my page i immediatly receive the error : this.getDoc() is null

The function getBody() of Editor.js gets called and the document seems to be not available

getBody : function() {
    return this.bodyElement || this.getDoc().body;
},

In this case getBody() has been triggered by the destroy() function in a gecko code block.

destroy : function(s) {
        var t = this;

        // One time is enough
        if (t.destroyed)
            return;

        // We must unbind on Gecko since it would otherwise produce the pesky "attempt to run compile-and-go script on a cleared scope" message
        if (isGecko) {
            Event.unbind(t.getDoc());
            Event.unbind(t.getWin());
            Event.unbind(t.getBody()); // here is the relevant getBody() call
        }

Destroy has been triggered by the function addUnload of tinymce.js

o.func.call(o.scope, 1);

What can i do to avoid this problem?

like image 589
Thariama Avatar asked Oct 22 '22 15:10

Thariama


2 Answers

happened to me when i upgraded jquery..

to resolve it just upgrade jquery to the latest version and also tinymce to the latest version..

i have found other solution for this problem while searching the net.. try to remove the filemanager,imagemanager form plugin list. When it is not set up properly it may cause some issues.

like image 61
Ludovit Scholtz Avatar answered Nov 04 '22 20:11

Ludovit Scholtz


Although this was already answered, I had the same problem but the solution was different than anything listed here. Essentially even with the latest and greatest of both jQuery and TinyMCE, I found that if 'external_plugins' is empty in the options for tinymce.init(), this error will occur upon unload/removal of the tinymce element.

For context, it happened to me after closing a bootstrap modal with tinymce and only during that, and it only happened when 'external_plugins' was empty, either null, empty object, or empty string, it doesn't like it there unless something is defined.

like image 44
simontemplar Avatar answered Nov 04 '22 20:11

simontemplar