After updating core to 8.4.1 which includes an update of ckeditor to version 4.7.3, the ckeditor stopped loading if ckwordcount is enabled.

Console gives me the following:

Error: [CKEDITOR.resourceManager.load] Resource name "htmlwriter" was not found at "http://www.example.com/core/assets/vendor/ckeditor/plugins/htmlwriter/plugin.js?t=oyshna".
	(anonyme Funktion) (ckeditor.js:254:188)
	f (ckeditor.js:249:194)
	D (ckeditor.js:249:334)
	w (ckeditor.js:249:417)
	onerror (ckeditor.js:250:365)

Comments

ABaier created an issue. See original summary.

kevinquillen’s picture

This was removed from core, is that what you are saying? I had never heard of htmlwriter.

https://ckeditor.com/cke4/addon/htmlwriter

ABaier’s picture

It seems that it has never been there, but we have a dependency to it in "libraries/wordcount/plugin.js" on line 9.

CKEDITOR.plugins.add("wordcount", {
    lang: "ar,ca,da,de,el,en,es,fi,fr,he,hr,it,jp,nl,no,pl,pt,pt-br,ru,sv,tr,zh-cn", // %REMOVE_LINE_CORE%
    version: 1.15,
    requires: 'htmlwriter,notification,undo',
    init: function (editor) {
        var defaultFormat = "",
ABaier’s picture

just updated the library to 1.17, but with the same problem.

kevinquillen’s picture

Drupal 8.4.x core is still coming bundled with htmlwriter. Taken from ckeditor.js:

CKEDITOR.plugins.add("htmlwriter",{init:function(a){var e=new CKEDITOR.htmlWriter

It also looks like it is part of core CKEditor: https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev_output_format

That is to say, this module does not provide it, the plugin assumes it exists (it should).

I have not had time to debug yet. 1.16 should definitely work - I have not tried 1.17. Are there any change logs for 8.4.1 to indicate a change here?

kevinquillen’s picture

Note that for 8.4.2, CKEditor was downgraded back:

This release downgrades the ckeditor library included with Drupal core from version 4.7.3 to 4.7.2, otherwise it is identical to Drupal 8.4.1.

See: #2908864: Update CKEditor library to 4.7.3

Can you upgrade to 8.4.2 and see if the issue persists?

ABaier’s picture

Thanks for the info, Kevin. I will be able to test this after the weekend.

ABaier’s picture

I can confirm that core 8.4.2 works with ckwordcount and the wordcount library version 1.17.

Thanks for the quick fix!

kevinquillen’s picture

Status: Active » Fixed
kevinquillen’s picture

Status: Fixed » Closed (fixed)

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