Project

General

Profile

Actions

Bug #101401

closed

Epic #99669: CKEditor5 Collection

Undefined array key "ui" in vendor/typo3/cms-rte-ckeditor/Classes/Form/Element/RichTextElement.php

Added by Georg Tiefenbrunn 10 months ago. Updated 8 months ago.

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' }

Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Feature #101128: CKeditor implement bidi and language Plugin againUnder Review2023-06-20

Actions
Related to TYPO3 Core - Bug #100873: CKEditor language files missingResolved2023-05-13

Actions
Actions #1

Updated by Georg Tiefenbrunn 10 months ago

  • Related to Feature #101128: CKeditor implement bidi and language Plugin again added
Actions #2

Updated by Georg Tiefenbrunn 10 months ago

Actions #3

Updated by Georg Tiefenbrunn 10 months ago

  • Related to Bug #100873: CKEditor language files missing added
Actions #4

Updated by Gerrit Code Review 10 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80112

Actions #5

Updated by Gerrit Code Review 10 months ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80113

Actions #6

Updated by Gerrit Code Review 10 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80112

Actions #7

Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80112

Actions #8

Updated by Gerrit Code Review 9 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80575

Actions #9

Updated by Torben Hansen 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benjamin Franzke 8 months ago

  • Parent task set to #99669
Actions

Also available in: Atom PDF