CodersCare / l10nmgr

GNU General Public License v3.0
0 stars 9 forks source link

Default RTE Preset "Minimal" Triggers Exception #36

Open Scopestyle opened 11 months ago

Scopestyle commented 11 months ago

l10nmgr Version: 11.2.0 TYPO3: 11.5.33 PHP Version: 8.0

Error: The default RTE Preset Minimal does not contain a part extraPlugins, the l10n code requires this in l10nmgr/Classes/View/L10nHtmlListView.php. Because the part is missing in the default config in typo3/sysext/rte_ckeditor/Configuration/RTE/Minimal.yaml l10nmgr is throwing an error, this needs to be adressed.

Log Error:

Mon, 11 Dec 2023 09:07:35 +0100 [CRITICAL] request="fe10c98d0154f" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB: BE): TypeError, code #0, file /html/typo3-dev/typo3conf/ext/l10nmgr/Classes/View/L10nHtmlListView.php, line 219: array_flip(): Argument #1 ($array) must be of type array, null given - {"mode":"WEB","application_mode":"BE","exception_class":"TypeError","exception_code":0,"file":"/html/typo3-dev/typo3conf/ext/l10nmgr/Classes/View/L10nHtmlListView.php","line":219,"message":"array_flip(): Argument #1 ($array) must be of type array, null given","request_url":"https://{redacted}/typo3/module/LocalizationManager?token=--AnonymizedToken--&id=1&srcPID=1&exportUID=2","exception":null}

Code in L10nHtmlListView.php:

$configuration['extraPlugins'] = implode(',', array_flip(array_flip($configuration['extraPlugins'])));
Konafets commented 11 months ago

As this key is only accessed if the configuration has the editor.externalPlugins key:

https://github.com/CodersCare/l10nmgr/blob/3ee71720066bafdf2c5abd736c1f97c6f3ae61ec/Classes/View/L10nHtmlListView.php#L195-L196

However, I think the code should also check if there is a the key extraPlugins present in the configuration array.