ckeditor's javascript does some squirrely stuff that breaks the awesome and pretty important CDN module. Namely, it adds additional scripts on demand client-side, which bypasses CDN's rewriting of the URLs.

The ckeditor module works just fine, because it has an option of loading the javascript via a CDN, skipping the problem entirely. I propose editor does the same.

Thanks.

CommentFileSizeAuthor
#9 2647854-9.patch4.54 KBdevin carlson
#8 Capture.PNG13.93 KBkeithdoyle9

Comments

captainack created an issue. See original summary.

devin carlson’s picture

Title: editor_ckeditor breaks CDN... Support load of ckeditor script from their CDN to skip the problem » Add CKEditor CDN support
Version: 7.x-1.0-alpha6 » 7.x-1.x-dev
Category: Bug report » Feature request
Issue summary: View changes

Editor and Editor CKEditor mirror the Editor and CKEditor modules included with Drupal 8 core.

I'd suggest filing an feature request against the core D8 CKEditor module and referencing it here.

captainack’s picture

Thanks Devin. Will do.

captainack’s picture

Hmm... I haven't learned Drupal 8 yet. I'm trying to read the code to determine if the issue even exists in Drupal 8 or not, but I can't tell if aggregation is disabled for loading of the ckeditor js files. I see the .yml files, but I can't find where the library is being attached.

Also, since CDN hasn't been ported to D8 yet, nobody will have seen this on D8.

What happens if this is ends up unique to D7? Is it still worthwhile?

wim leers’s picture

wim leers’s picture

Category: Feature request » Bug report

I found the root cause.

Drupal 8 core's CKEditor::getJSSettings() calls file_create_url() for every external plugin file. And in ckeditor.js, _loadExternalPlugins() informs CKEditor about those external plugin URLs. This ensures it works fine even when CKEditor is loaded from a CDN.

This Drupal 7 backport of the same code doesn't do that. editor_ckeditor_get_settings() should be updated to use file_create_url() when generating the $external_plugins variable. Then this problem will go away :)

adminerms’s picture

keithdoyle9’s picture

StatusFileSize
new13.93 KB

Getting an error that CKEDITOR is not defined after switching to serving JS files via CDN. However, the CKEDITOR object is available in the console.

JS Aggregation is on

ScreenCap

devin carlson’s picture

Category: Bug report » Task
Status: Active » Needs review
StatusFileSize
new4.54 KB
devin carlson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.