If I choose aggregate and compress javascript files, the ckeditor on text field disappears and we can't type anything.

If other text format is chosen which does not use ckeditor, we can type in text field properly.

Files: 
CommentFileSizeAuthor
#4 ckeditor_aggregation-1940592-4.patch619 bytesWim Leers
PASSED: [[SimpleTest]]: [MySQL] 54,415 pass(es). View
#1 1940592.ckeditor-aggregation.1.patch559 bytesalexpott
PASSED: [[SimpleTest]]: [MySQL] 54,384 pass(es). View

Comments

alexpott’s picture

Status: Active » Needs review
Issue tags: +Needs manual testing, +Alex's D8 blog
FileSize
559 bytes
PASSED: [[SimpleTest]]: [MySQL] 54,384 pass(es). View

When ckeditors js is aggregated the path of the ckeditor file changes which breaks stuff... the specific JS errors are:

Failed to load resource: the server responded with a status of 404 (Not Found) http://drupal8alt.dev/node/skins/moono/editor.css?t=D2MB
Failed to load resource: the server responded with a status of 404 (Not Found) http://drupal8alt.dev/node/lang/en.js?t=D2MB

Basically ckeditor is loading these resources... and the path is being munged due to the fact aggregated files are saved to sites/default/files. One solution is to specify CKEDITOR_BASEPATH - see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Specifying_the_Ed...

The patch attached does this - maybe not it the right way.

But also this suggests an interesting issue... should ckeditor's skins/moono/editor.css and lang/en.js be aggregated?

To test

  1. install standard profile
  2. login as admin
  3. visit admin/config/development/performance
  4. enable js aggregation
  5. visit node/add/article

Status: Needs review » Needs work
Issue tags: -Needs manual testing, -Alex's D8 blog

The last submitted patch, 1940592.ckeditor-aggregation.1.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
Issue tags: +Needs manual testing, +Alex's D8 blog
Wim Leers’s picture

Issue tags: +sprint, +Spark, +CKEditor in core
FileSize
619 bytes
PASSED: [[SimpleTest]]: [MySQL] 54,415 pass(es). View

I think a better approach would be to exclude CKEditor from aggregation. It's >400 KiB (ungzipped) on its own already, so that makes sense. It makes even more sense when you consider that CKEditor, when it would be part of other aggregates, would increase those aggregates with >400 KiB. Drupal's pretty poor aggregation system thus has the potential to cause CKEditor to be part of different aggregates.

Simple example:
- page A: foo.js + bar.js + CKEditor's JS = foobarcke.js
- page B: foo.js + baz.js + CKEditor's JS = foobazcke.js

Assuming foo.js, bar.js and baz.js are all 10 KiB when aggregated, we're now forcing the user who visits both pages to download 420 + 420 = 820 KiB instead of 20 + 400 + 20 = 440 KiB.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Knew is was doing it wrong... this is rtbc... but aggregation and gzip-ness should be separate - as proposed on #1926228-6: Performance page provides incorrect/incomplete information about CSS and JS compression

webchick’s picture

Priority: Normal » Major
Status: Reviewed & tested by the community » Fixed

This actually sounds like a pretty bad bug. Glad it was easy to fix. :)

Committed and pushed to 8.x. Thanks!

Wim Leers’s picture

Issue tags: -Needs manual testing, -sprint

.

Wim Leers’s picture

Issue tags: +Needs manual testing

d.o fail — "sprint" tag was not actually removed :/

Wim Leers’s picture

Title: Ckeditor disappears when caching and compression is enabled » CKEditor disappears when caching and compression is enabled

Sorry. I'm a pedant when it comes to writing :)

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