Skip to content
Snippets Groups Projects
Commit 0d2d8d92 authored by Andreas Kienast's avatar Andreas Kienast
Browse files

[BUGFIX] Merge code editor settings properly

The settings for the `typo3-t3editor-codemirror` element were passed in
an `options` attribute, which is unknown. This leads to the issue that
e.g. the `readOnly` flag set in TCA is ignored.

The composed settings are now properly merged.

Resolves: #104084
Releases: main, 12.4
Change-Id: I7e34a8230764c33b7924128176088ab32cb35a58
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84699


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
parent 19ce6696
Branches
Tags
No related merge requests found
......@@ -115,7 +115,7 @@ class T3editorElement extends AbstractFormElement
$settings = [];
if ($parameterArray['fieldConf']['config']['readOnly'] ?? false) {
$settings['readOnly'] = true;
$settings['readonly'] = true;
}
$editorHtml = $this->getHTMLCodeForEditor(
......@@ -213,13 +213,12 @@ class T3editorElement extends AbstractFormElement
$keymaps[] = $keymap;
}
}
$codeMirrorConfig = [
$codeMirrorConfig = array_merge($settings, [
'name' => $name,
'mode' => GeneralUtility::jsonEncodeForHtmlAttribute($mode->getModule(), false),
'addons' => GeneralUtility::jsonEncodeForHtmlAttribute($addons, false),
'keymaps' => GeneralUtility::jsonEncodeForHtmlAttribute($keymaps, false),
'options' => GeneralUtility::jsonEncodeForHtmlAttribute($settings, false),
];
]);
$code[] = '<typo3-t3editor-codemirror ' . GeneralUtility::implodeAttributes($codeMirrorConfig, true) . '>';
$code[] = '<textarea ' . GeneralUtility::implodeAttributes($attributes, true) . '>' . htmlspecialchars($content) . '</textarea>';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment