Actions
Bug #101401
closedEpic #99669: CKEditor5 Collection
Undefined array key "ui" in vendor/typo3/cms-rte-ckeditor/Classes/Form/Element/RichTextElement.php
Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2023-07-20
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Revision 44d96519 added two unchecked array key access (RichTextElement.php L193 and L198)
$uiLanguage = $ckeditorConfiguration['options']['language']['ui']; if ($this->translationExists($uiLanguage)) { $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/ckeditor5/translations/' . $uiLanguage . '.js'); } $contentLanguage = $ckeditorConfiguration['options']['language']['content']; if ($this->translationExists($contentLanguage)) { $resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create('@typo3/ckeditor5/translations/' . $contentLanguage . '.js'); }
$ckeditorConfiguration
is generated in RichTextElement::prepareConfigurationForEditor() and is based on the editor.config
array from the RTE yaml files.
CKeditor's text part language feature uses the config.language.textPartLanguage
configuration option. This feature is currently missing (see #101128), but if configured in RTE yaml causes prepareConfigurationForEditor() to assume the UI language of the editor if hard-coded (empty($configuration['language'])
is checked instead of empty($configuration['language']['ui'] ?? null)
).
RTE configuration causing exception¶
editor: config: language: textPartLanguage: - { title: 'English', languageCode: 'en' } - { title: 'French', languageCode: 'fr' } - { title: 'German', languageCode: 'de' }
Workaround¶
editor: config: language: # Use hard-coded UI language ui: en textPartLanguage: - { title: 'English', languageCode: 'en' } - { title: 'French', languageCode: 'fr' } - { title: 'German', languageCode: 'de' }
Actions