Project

General

Profile

Actions

Bug #92248

closed

Extend sys_file_metadata with RTE field throws exception with language id > 0

Added by Chris Müller about 4 years ago. Updated almost 4 years ago.

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

100%

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

Description

I extended the sys_file_metadata table with a field which enables the RTE. When I now want to translate a metadata record in File > Filelist (language id > 0) the following exception is thrown:

Return value of TYPO3\CMS\RteCKEditor\Form\Element\RichTextElement::getLanguageIsoCodeOfContent() must be of the type string, null returned
in /var/www/html/public/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php line 196

The reason is:
In Filelist the site languages are not known, so only -1 and 0 are available ($currentLanguageUid is 1 in my case):

$contentLanguage = $this->data['systemLanguageRows'][$currentLanguageUid]['iso'];

returns null, which violates the method return type (string).

A solution can be to return "en" as language for RTE when the current language is not found.

Actions #1

Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

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

Actions #2

Updated by Gerrit Code Review about 4 years ago

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

Actions #3

Updated by Gerrit Code Review about 4 years ago

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

Actions #4

Updated by Gerrit Code Review about 4 years ago

Patch set 1 for branch 10.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/+/66042

Actions #5

Updated by Chris Müller about 4 years ago

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

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF