Actions
Bug #92248
closedExtend sys_file_metadata with RTE field throws exception with language id > 0
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