[CKEditor.Reactive] Cannot read property 'call' of undefined
ckeditor-reactive
Reactive icon
Forge component by Fábio Fantato
Application Type
Reactive

Hi, 

Whenever I click on a top bar button or press the enter key this error message is displayed in the browser console, "Cannot read property 'call' of undefined". I think this could be the reason why the component is not working properly. 

Maybe it's the JQuery file?

This is happening with the demo component, so I didn't change any of the existing configuration.

My main problem is the "Enter" key, when you press the enter key inside the editor it creates 2 <p> tags, the original Ckeditor creates only one, can someone help me with this issue?

Try opening each esapace of your application including ckeditor itself, refreshing references and republishing. Cannot read property type errors are fairly common if you have out of date references.

I've tried what you suggested but unfortunately had no success. What worked out for me was to download a previous version of this component (1.0.6). The Enter key problem is solved.

You can see the issue I'm talking about in the demo page. When you press Enter it adds 2 <p> tags, and also the error message "Cannot read property 'call'...". 

I still hope to use a new version of this component with this bug fixed. 

If someone can help I appreciate it.  

Hey Rhuan,

As an hotfix replace this piece of code, paste this into the CKEditor.js of the CKEditorReactive Module.


        if (ssInput[0]) {

        

            //Update function, to trigger events

            $('#' + ssInputId)[0].ckEditorUpdate = function () {

                setTimeout(function () {

                    if (typeof CKEDITOR.instances[ssInputId] !== 'undefined' && CKEDITOR.instances[ssInputId].checkDirty()) {

                        var editor = CKEDITOR.instances[ssInputId];

                        $('#' + ssInputId).val(editor.getData());

                        editor.resetDirty();

                        $('#' + ssInputId).trigger('change');

                    }

                }, 100);

            };

        

            var ckConfig = {};

            if (ssConfig !== "{}") {

                ckConfig = JSON.parse(ssConfig);

            } 

            //Set some config values

            ckConfig.language = ssLanguage;

            ckConfig.uploadUrl = ckConfig.uploadUrl || '/CKEditorReactive/rest/api/Upload';

            ckConfig.filebrowserUploadUrl = ckConfig.filebrowserUploadUrl || ckConfig.uploadUrl;

            ckConfig.height = ssHeight;

            ckConfig.on = {

                saveSnapshot: $('#' + ssInputId)[0].ckEditorUpdate,

                key: $('#' + ssInputId)[0].ckEditorUpdate,

                afterCommandExec: $('#' + ssInputId)[0].ckEditorUpdate,

                change: $('#' + ssInputId)[0].ckEditorUpdate

            };

                

            CKEDITOR.replace(ssInputId, ckConfig);

            

        } else {

            

            CKEDITOR.removeAllListeners();

            delete CKEDITOR.instances[ssInputId];

            console.error("Configured textarea element with id:" + ssInputId + " is not present on page.");

        }

It's only the Orange part that needs replacement, i just put the entire function for safe measure.

Btw: thanks for the tip with the 1.0.6 version working, i just replaced the code with the older one.

Pedro Carvalho

I have uninstalled and installed the module from the beginning. I have pasted the code you provided. 

But I get the same error message as Rhuan. 

It happens both on Enter and on Click on any element in editor.


With this error the editor still works and you can save HTML string to the database. The problem that I encounter is that when I select bullet point and type the first item, and then I hit Enter, it goes to the next line without a bullet point. So I have to select bullet point again to make it for the second line, and the same process for the rest of lines. It annoys my users a lot. And I don't have any ideas left on how to troubleshoot it.

Here is the file that i used.

Replace this file in the latest version of the Component and make sure it gets refreshed.

CKeditor.txt

Thank you for a quick response. It worked!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.