Bug #101437
closedEpic #99669: CKEditor5 Collection
rte_ckeditor externalPlugins with resource configuration doesn't work
100%
Description
Following configuration doesn't work:
externalPlugins: example: resource: 'EXT:example/Resources/Public/CKeditor/Plugins/example/plugin.js'
in vendor/typo3/cms-rte-ckeditor/Classes/Form/Element/RichTextElement.php it appears that the configuration is mistakenly being set empty line 299.
foreach ($externalPlugins as $pluginName => $configuration) { $pluginConfiguration[$pluginName] = [ 'configName' => $configuration['configName'] ?? $pluginName, ]; if ($configuration['resource'] ?? null) { $configuration['resource'] = $this->resolveUrlPath($configuration['resource']); } unset($configuration['configName']); unset($configuration['resource']); // <- this line if ($configuration['route'] ?? null) { $configuration['routeUrl'] = (string)$uriBuilder->buildUriFromRoute($configuration['route'], $urlParameters); } $pluginConfiguration[$pluginName]['config'] = $configuration; }
If I comment out this line, the path returned in $configuration['resource'] also does not exist.
Updated by Torben Hansen over 1 year ago
A fix for this would be as following:
if ($configuration['resource'] ?? null) { $pluginConfiguration[$pluginName]['resource'] = $this->resolveUrlPath($configuration['resource']); }
However, the whole plugin architecture changed in CKEditor 5 and AFAIK the whole externalPlugins
configuration with resource
has been removed in CKEditor 5 core, so fixing this bug in TYPO3 will have no effect. CKEditor 5 does not use externalPlugins
at all and in TYPO3 context this is only used as configuration storage for plugins (currently only to define the route to rteckeditor_wizard_browse_links
of the typo3link
plugin).
With TYPO3 12.4 and CKEditor 5, additional plugins must be imported using editor.config.importModules
as shown in the default configuration. The documentation is outdated (https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/Configuration/Examples.html#how-do-i-add-custom-plugins and everything below) and must be updated.
Updated by Benjamin Franzke over 1 year ago
- Related to Bug #100784: CKEditor 5 - Configuration of custom CKeditor 5 plugin via RTE.editor.config.{customPlugin} not possible added
Updated by Kai Tallafus over 1 year ago
I noticed that too. I have a custom plugin using the editor.externalPlugins config with a route name defined (like the typolink plugin). While the configuration is correctly parsed and returned in TYPO3\CMS\RteCKEditor\Form\Element\RichTextElement::getExtraPlugins() (and event rendered onto the <typo3-rte-ckeditor-ckeditor5 /> options attribute),the config is not available inside my ckeditor plugin (this.editor.config). The typolink plugin config (routeUrl) is there...
Why is that?
Updated by Benjamin Franzke over 1 year ago
- Related to Task #101465: Update ext:rte_ckeditor documentation added
Updated by Gerrit Code Review over 1 year 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/+/81381
Updated by Gerrit Code Review over 1 year 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/+/81381
Updated by Gerrit Code Review over 1 year 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/+/81388
Updated by Anonymous over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset bd5a93e1c7576b40de34025b8195c2ca844eaf88.
Updated by Gerrit Code Review over 1 year ago
- Status changed from Resolved 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/+/81406
Updated by Gerrit Code Review over 1 year 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/+/81406
Updated by Gerrit Code Review about 1 year 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/+/81535
Updated by Gerrit Code Review about 1 year ago
Patch set 2 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/+/81535
Updated by Anonymous about 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset 34384bb8614d8c914063ca20adb32315d9b48902.