JavaScript void links in OpenCms 6.2.3 WYSIWYG
Just a quick note: There was a long standing problem regarding the FCKEditor (HTML editor) in OpenCms 6.2.X using Firefox 3. Adding links always produced an URL like javascript:void(0)/*1241321*/. Since most customers are already on OpenCms 7 this is not such a big problem but recently I had to look for a fix. It turned out the bug was quite popular and there is quite an easy workaround.
Open the file /system/workplace/resources/editors/fckeditor/editor/js/fckeditorcode_gecko_2.js in OpenCms and replace the text:
FCK.ExecuteNamedCommand('CreateLink',B);var C=document.evaluate
with:
FCK.ExecuteNamedCommand('CreateLink',B);var C=this.EditorDocument.evaluate
Publish the file and this should be it. Don’t forget to empty your browser cache afterwards (don’t just press CTRL+F5) otherwise you will still get the old file.
Of course this is not a real fix, but if you have to get rid of the problem fast. This can help.
Update: In OpenCms 6.2.3 the file is called fckeditorcode_gecko.js not fckeditorcode_gecko_2.js.
Tags: Development, FCKEditor, OpenCms

February 4th, 2009 at 11:05 am
Thank you for the workaround. Unfortunately, it doesn’t work for me.
The code you posted is correct, no problem there. The problem is that the updated and published file just doesn’t get exported from VFS to server file system where it should be available from URL http://open.cms.server/resources/editors/fckeditor/editor/js/fckeditorcode_gecko.js.
Shall I re-initialize the workplace? Or just copy the file to server and overwrite the old one?
P.S. I have cleared my cache. The version is 6.2.3.
February 4th, 2009 at 3:36 pm
Hi Roman,
have you tried it using a different browser/pc? Maybe there is a caching proxy server between the server and your PC. You can try to reinitialize the workplace but I doubt that this will work (because it is not directly related). The caching is really tricky because the file is included in a very complicated way.
I would recommend try using a different PC/dialin.
If you still have problems, please ask again. I just remeber that I had some problems getting the cache cleared, so maybe it’s the same for you.
Best regards and good luck,
Sebastian
February 4th, 2009 at 6:45 pm
Thank you for your quick reply, Sebastian. I have tried other browsers, other PCs, you name it, it doesn’t work.
Now, the really tricky part: this fix worked for a couple of days, then the old file reappeared from nowhere! The file in the VFS was still the same (containing the fix), but browsers got the old file from the URL in my first post. And those browsers had their caches cleared. I guess it has something to do with clustering (OCEE) or server-side caching but I don’t know much about it.
I know this is not connected to your fix, but I thought maybe some OpenCms wizard would know why this happened. I will post this question to forums, because somebody might have had similar experience.
For now, the only thing I can think of is to overwrite the file on server’s file system.
February 4th, 2009 at 7:02 pm
Hi Roman,
as far as I know the OCEE cluster has a dedicated workplace server so in theory(!) it is unlikely that this causes the problem (although I have had problems with clustering and the frontend). I think it is related to some server side caching.
I would recommend tracking down the problem starting at the application server. Simply do an HTTP request starting from the application server (this should not go through any proxy (hopefully)) and then look if you still get the wrong version. Then you can step back one node at a time and find out the component that’s causing the problem.
This is how I found out that the transparent HTTP proxy in a firewall component was enabled (and nobody knew it was there).
February 4th, 2009 at 10:18 pm
You are right., OCEE is most likely not the guilty party. I will try your advice and hopefully find the component that caused this.
March 31st, 2009 at 4:52 pm
I finally found the cause. There was another server that was rsyncing Java classes among servers in the cluster. It also rsynced resources with Javascript files.
March 31st, 2009 at 5:48 pm
I’m glad you found the problem! These are the kinds of problems that drive me nuts! Thanks for reporting back.
April 8th, 2009 at 5:20 pm
I am running OpenCMS 6.2 and have this same issue described on this webpage. However when I change the fsckeditor JS file to the “this.EditorDocument” my fsckeditor dissappears when I select the edit function of a webpage. Is there something else I need to do?
If I revert the file back the editor appears again but obviously nothing is fixed.
Suggestions?
April 8th, 2009 at 7:19 pm
Hi Bryce,
first make sure that you are running 6.2.3.. maybe there was a difference in another version. Then maybe use bugzilla and the JS console to get a detailed error JS message.
Also check the right file. See:
I’m sorry but I don’t know another solution from the top of my head.
Best regards,
Sebastian
April 8th, 2009 at 8:24 pm
Thanks for the reply. Yes I am running 6.2.3 and fckeditor 2.3.2. The file I edited was the one described.
Is it possible I am not using the fckeditor? I see in my modules HtmlArea WYSIWYG editor plugin and LEdit editor. How do I know which one is the primary?
Or would the change I did earlier that created the disappearance of the editor mean that its installed/loaded?
-Bryce
April 9th, 2009 at 6:05 pm
Hi Bryce,
just open the preferences dialog and open the editor tab. There you can set the used editor.
best regards,
Sebastian
April 9th, 2009 at 7:42 pm
It just says “best available” for all the options listed under “preferred editors”
hmmm….
April 14th, 2009 at 6:15 pm
Hi Bryce,
sorry for commenting so late (I took a few days off). Have you resolved your issue?
best regards,
Sebastian