[CKEditor] js error with CKEditor in Java stream of OS9.1 enterprise

[CKEditor] js error with CKEditor in Java stream of OS9.1 enterprise

Forge Component
Published on 19 Feb by Carlos Henriques
12 votes
Published on 19 Feb by Carlos Henriques
CKEditor won't load in the enterprise environment.  The generated id have a colon separating the webblogs and spaces.  ie block:maincontent:popup, rather than block_maincontent_pop as generated from a .NET environment.  The problem occurs when running eval('CKEDITOR.instances.' + inputId) where inputId contains ':' characters.

Line 9, 14 and 15 of CKEditor.js
?eval('CKEDITOR.instances.' + inputId) 

Hi Steve,

After our troubleshooting today we found out that this is related to your Enterprise environment being in Java-stack, and due to JavaServer Faces (JSF) technology in use which does not allow configuration of separators. Can you please check if this post can help you work around it?

Hi Pedro, BTW, this RTE window doesn't work very well on explorer edge. I have to edit the source to get started with a message. Some might advise me to stop using edge ... probably a good suggestion.

Anyway - I have a mostly functioning CKEditor now. the "\:" workaround doesn't really work. The failure was occurring in eval() which is JS level, not jQuery level. Additionally I could already see some code in there that appeared to be splitting the variable name string by ":" and injecting a "\:" value.

I ended up referencing the object via CKEDITOR.instances[inputId] instead of eval('CKEDITOR.instances.' + inputId) and substituting typeof(CKEDITOR.instances[inputId]) != "undefined" instead of hoping eval() would produce a true or false.  It's now showing the CKEditor window and is writing the input back to the text input field.  However it's triggering an error on an object in the partially minified OSAjax lib so I can't really see what's causing it.

Uncaught TypeError: Cannot read property 'target' of undefined 

OsLimitInput @ _osjs.js:5
Just a followup on this.  The final error is due to a change in ckeditor's onChange function not being updated in this module. The line in the CKEditor initialisation script  


should be