I think this happened to me some weeks ago but I am blogging about it only now (the last month or so has been overly hectic, so no time for “exotic” activities like blogging).
In an ASP.NET website installation that has been running perfectly for months and using CKEditor for wysiwyg content entry, suddenly the users started reporting they can no longer click the “Link” button in the editor toolbar to bring up the Link dialog for turning the selected text to a hyperlink.
We had not done any recent update to the installation, so the issue came as a surprise to me. On basic inspection, I found CKEditor was throwing this error when I clicked on the “Link” button in the toolbar:
[CKEDITOR.dialog.openDialog] Dialog "link" failed when loading definition
Hmmm, what could cause that, I thought as I began researching into the issue. A quick Google search brought up many result links with the same issue, so I thought others have faced it too and I might be in for an easy solution.
However all googling results directly or indirectly took me to this ticket on CKEditor’s developer site which says the issue occurs in IE 6 (causing no dialogs to open in IE 6). A patch was also available. But I was not interested as I was facing the issue in Chrome browser and in every other browser I tested upon. So this ticket did not apply to me and I continued looking for another solution. I got nothing on the web which pointed in another direction for this issue apart from the above ticket page.
So I sat down and observed the issue more closely including http traffic. And as soon as I did that (monitored http traffic), I got my solution. I noticed a “404 (Not Found)” error for the javascript file “ckeditor/plugins/link/dialogs/link.js” after I clicked the “Link” button. Why on earth this would happen I said to myself. And when I checked the web-server, I noticed the whole “ckeditor/plugins/link” directory missing (which contains the files that make up the “link” plugin for CKEditor). I also noticed some other plugin directories missing.
As I restored the missing plugin directories on the web-server, refreshed the browser and clicked the “Link” button, the issue went away and voila, I had CKEditor’s link dialog in front of me.
I checked CKEditor’s source code then and was able to confirm that CKEditor throws this error when it fails to load the scripts necessary for creating a plugin’s dialog. Here’s the relevant piece of code from its source:
throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+l+'" failed when loading definition.');
So next time you see ‘Dialog “plugin name” failed when loading definition’ issue, you would want to check a couple of things:
- You are not using an outdated CKEditor version on IE 6 (see this ticket page). If yes, either patch your CKEditor script file or upgrade to latest editor version.
- The plugin’s directory or script files are not missing from the ckeditor\plugins directory on your web-server.
I still wonder how these plugin directories got removed in my case (webmasters for the server deny having done anything with the installation), I guess this would remain a mystery.
Hey, I was encounter the same problem, and go to google, after several page and site, finally i get to urs.
Would like to thank you very much for ur post, it did help me solve it. Very nice!
Keep up the good works!
John
it’s helpful!!! thank you very much. while reading this i just member that i deleted the entire folder for saving space….. oops~~~
Thanks, this solved my linking problem. Strange how directories can just dissapear…
In my case I’m using Zymic host, a free hosting service, though I’m not sure if it’s to blame.
Thank you man, you text help me a lot!
Thanks, pointed me in the right direction
Hi,
Your suggestion was quite helpful. But My scenario is little bit different.
In my case, when there is session time out , CKEditor/Plugins files are not being loaded where as in case session is established CKEditor/Plugins files are being uploaded. Need urgent resolution for this.
Can you provide your feedback on this.
Thanks and Regards
Priya
Hi Priya,
CKEditor files are not affected by your server-side sessions. Those are plain static js/css/image files. Generally speaking, access to static resource files should not be affected by server sessions or authentication cookies (unless there’s a specific use case).
As your problem emanates from intricacies of your server-side code, providing feedback won’t be possible per-se.
Hi Rahul ,
Thanks for your response.
On further analyzing the issue found that there is issue with “CKEDITOR.scriptLoader=function()” due to which files are not getting loaded dynamically and when I am trying to load the files then smiley and link dialogs are not getting open properly.
Kindly share you insights on this.
Below is the error from console :
openDialog http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:600
openDialog http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:600
f http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:229
y http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:229
A http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:229
onerror http://127.0.0.1:9090/tr/web/res/CKeditor/ckeditor.js:230
Hi Priya, this would depend upon a lot of things, including your CKEditor version, how you have set it up, are the plugins at their desired locations etc. Unfortunately it would be difficult looking into all that here. Try seeking help on CKEditor forums or Stack Overflow.