Project

General

Profile

Actions

Bug #101437

closed

Epic #99669: CKEditor5 Collection

rte_ckeditor externalPlugins with resource configuration doesn't work

Added by Jessica Jagodzinski 9 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2023-07-25
Due date:
% Done:

100%

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

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #100784: CKEditor 5 - Configuration of custom CKeditor 5 plugin via RTE.editor.config.{customPlugin} not possibleResolved2023-05-10

Actions
Related to TYPO3 Core - Task #101465: Update ext:rte_ckeditor documentationClosedTorben Hansen2023-07-28

Actions
Actions #1

Updated by Torben Hansen 9 months 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.

Actions #2

Updated by Benjamin Franzke 9 months ago

  • Related to Bug #100784: CKEditor 5 - Configuration of custom CKeditor 5 plugin via RTE.editor.config.{customPlugin} not possible added
Actions #3

Updated by Kai Tallafus 9 months 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?

Actions #4

Updated by Benjamin Franzke 8 months ago

  • Parent task set to #99669
Actions #5

Updated by Benjamin Franzke 8 months ago

  • Related to Task #101465: Update ext:rte_ckeditor documentation added
Actions #6

Updated by Gerrit Code Review 7 months 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

Actions #7

Updated by Gerrit Code Review 7 months 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

Actions #8

Updated by Gerrit Code Review 7 months 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

Actions #9

Updated by Anonymous 7 months ago

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

Updated by Gerrit Code Review 7 months 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

Actions #11

Updated by Gerrit Code Review 7 months 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

Actions #12

Updated by Gerrit Code Review 6 months 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

Actions #13

Updated by Gerrit Code Review 6 months 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

Actions #14

Updated by Anonymous 6 months ago

  • Status changed from Under Review to Resolved
Actions

Also available in: Atom PDF