denny / ShinyCMS

ShinyCMS is an open source CMS. This is the Perl version, built with Catalyst and DBIC. (There is also a Ruby on Rails version: www.github.com/denny/ShinyCMS-ruby)
58 stars 24 forks source link

CKEditor, Totally Broken With Javascript Error [CRITICAL] #44

Closed wbraswell closed 9 years ago

wbraswell commented 9 years ago

This is related to a now-closed issue: https://github.com/denny/ShinyCMS/issues/34

The new install of CKEditor full package has totally broken the WYSIWYG editor, now it doesn't show up at all, there is just a blank page area where the CKEditor should be. If I view the JavaScript console I can see several errors:

The value "device-width;" for key "width" is invalid, and has been ignored. edit:15

The value "1.0;" for key "initial-scale" was truncated to its numeric prefix. edit:15

The value "1.0;" for key "maximum-scale" was truncated to its numeric prefix. edit:15

Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. edit:15

Uncaught TypeError: Cannot read property 'ltr' of undefined ckeditor.js:589 CKEDITOR.plugins.add.init ckeditor.js:589 (anonymous function) ckeditor.js:241 p ckeditor.js:221 CKEDITOR.scriptLoader.load ckeditor.js:221 (anonymous function) ckeditor.js:240 (anonymous function) ckeditor.js:228 (anonymous function) ckeditor.js:226 p ckeditor.js:221 CKEDITOR.scriptLoader.load ckeditor.js:221 CKEDITOR.resourceManager.load ckeditor.js:226 g ckeditor.js:227 (anonymous function) ckeditor.js:228 p ckeditor.js:239 (anonymous function) ckeditor.js:238 (anonymous function) ckeditor.js:444 (anonymous function) ckeditor.js:226 p ckeditor.js:221 u ckeditor.js:221 t ckeditor.js:221 (anonymous function) ckeditor.js:222

denny commented 9 years ago

Hrm. I can't reproduce this. I've double-checked with both my old dev install and a fresh clone of the repository, and although I do see the first four warnings, I don't see the TypeError, and I do get a working CKEditor.

denny commented 9 years ago

The warnings are to do with this line of the HTML by the way: < meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" >

... so, nothing to do with the editor. They occur on all pages, front-end and admin side, with or without WYSIWYG editors. I'll look into tidying those up, but I doubt they're a factor here.

What I can't figure out is whether the TypeError is related to the cause of your CKEditor not appearing, or if it's just a symptom... it reads to me like that error is caused by the CKEditor not being there, rather than causing the CKEditor not to be there, iyswim.

denny commented 9 years ago

Ah. Here's the first result Google suggests when I search for that TypeError line: http://dev.ckeditor.com/ticket/9965

Can you try deleting your browser cache please?

wbraswell commented 9 years ago

Well time has passed and somehow this problem has inexplicably fixed itself. Maybe the web browser automatically cleared its cache? Either way it works perfectly now!

kevinyan815 commented 9 years ago

I can answer the problem “Uncaught TypeError: Cannot read property 'ltr'”, I encountered the same problem recently and basically it was caused by miss language file in lang directory(in customization do not select all languages).

So you need add one rule in you configuration

config.language = 'en' (file name in your lang directory);

and clear the browser cache as well.

wbraswell commented 9 years ago

Thanks for the insight, @kevinyan815 !