Project

General

Profile

Actions

Bug #88302

closed

CKEditor language plugin not loadable, crash

Added by dermueller no-lastname-given almost 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2019-05-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I use TYPO3 version 8.7.25. My YAML configuration file for CKEditor works fine in general, so there is no problem with not accepting my configuration in general. But:

editor:
  externalPlugins:
    language: { resource: "EXT:rte_ckeditor/Resources/Public/JavaScript/Contrib/plugins/language/" }

This crashes the RTE.

Browser console says: "TypeError: e.toLowerCase is not a function > ckeditor.js:244:345"

The results of my investigation so far:

sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js has this method:

load:function(a,e,b){a&&CKEDITOR.lang.languages[a]||(a=this.detect(e,a));

if "a" is not present, the detect method is executed:

detect:function(a,e){var b=this.languages;e=e||navigator.userLanguage||navigator.language||a;var c=e.toLowerCase()...

This variable "a" is "languageCode" in the original code from https://github.com/ckeditor/ckeditor-dev/blob/major/core/lang.js

So, back to sysext/rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js, we find

CKEDITOR.lang.load(a.config.language

But config.language is empty. Setting this in YAML has no effect:

editor:
  config:
    language: "de" 

The only thing that works is manipulation of ckeditor.js itself, by chaning the line above to (and thus skipping detection):

load:function(a,e,b){a&&CKEDITOR.lang.languages[a]||(a="de");

Files

Actions

Also available in: Atom PDF