Review main Abandoned

60816[BUGFIX] Prevent overriding ckeditor config from plugins

Rémy DANIEL CR 0 V 0 Easy +7 −5 updated 02/17/20, 17:49

Commit message

Currently, the configuration of an external plugin is injected
into the editor's configuration using the name of the plugin as
config key. This can lead to an overriding if the name of the external
plugin is the same as a existing config key.

This patch stores the external plugins configuration into an
underscored config key, and update plugins to use this new key.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 1822

  1. Rémy DANIEL uploaded patch set 1 05/24/19, 14:04

  2. Rémy DANIEL updated the commit message in patch set 2 05/24/19, 14:08

  3. TYPO3com voted on patch set 1 V +1 05/24/19, 14:17 Completed build in 12m 48s on Fri, 24 May, 04:17 PM Test Summary: 46470 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34025

  4. TYPO3com voted on patch set 2 V +1 05/24/19, 14:24 Completed build in 15m 47s on Fri, 24 May, 04:24 PM Test Summary: 46470 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34026

  5. Rémy DANIEL updated the commit message in patch set 3 05/24/19, 15:17

  6. TYPO3com voted on patch set 3 V +1 05/24/19, 15:29 Completed build in 12m 08s on Fri, 24 May, 05:29 PM Test Summary: 46470 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34032

  7. Rémy DANIEL commented on patch set 3 06/03/19, 16:01

    Maybe it is a breaking change, because the plugin's config will now reside in within an undescored namespace.
  8. Benni Mack commented on patch set 3 06/04/19, 09:18

    that would mean everybody needs to update their existing (v8+v9) extensions with plugin to make this compatible? Sounds risky.
  9. Rémy DANIEL commented on patch set 3 06/04/19, 14:09

    > Patch Set 3: > > that would mean everybody needs to update their existing (v8+v9) extensions with plugin to make this compatible? Sounds risky. Well, yes. That's why this change should be anounced as breaking. Actually, because of this issue, nobody can activate the plugin "language" which is included with ckeditor in v8+v9. Should I propose the breaking change only for master, and a "temporary" fix for v8+v9 that does not break anything?
  10. Rémy DANIEL uploaded patch set 4 06/21/19, 09:55

  11. TYPO3com voted on patch set 4 V +1 06/21/19, 10:06 Completed build in 11m 15s on Fri, 21 Jun, 12:06 PM Test Summary: 46448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34473

  12. Tobi Kretschmann voted on patch set 4 CR +1 07/10/19, 09:51

  13. Steffen Frese voted on patch set 4 CR +1 07/12/19, 06:49

  14. Guido Schmechel commented on patch set 4 07/13/19, 22:31

    Like in the issue: As mentioned in the ticket: Can the code also be used for 9.5? I would also be for a merge in 8.7
  15. Rémy DANIEL commented on patch set 4 07/14/19, 09:45

    Reply Unresolved

    Yes the fix works also with 9.5 or 8.7, but it can breaks existing CKEditor custom plugins.
  16. Frank Nägler wrote 01/17/20, 14:49

    Topic set to CKEditor
  17. Benjamin Kott commented on patch set 4 V -1 CR -1 01/20/20, 22:43

    Ok, checked the patch and we actually have a conceptional issue here that is not in line with how ckeditor should be configured. The problem is in the initial implementation and the assumption that external plugins actually have a configuration outside the editor config and that the name is always identical to the plugin name. The configuration for a plugin can be chosen by the plugin developer and does not need to follow any naming scheme. Adding an underscore does not help in this case since it will break current installations with custom plugins and is not a solution. We need to provide a workaround for this. I will provide a dedicated patch for this that is mitigating the issue. In the long run we should deprecate the config settings in the externalPlugins section and move it to editor.config as intended.
  18. Benjamin Kott commented on patch set 4 01/20/20, 23:05

  19. Rémy DANIEL commented on patch set 4 01/21/20, 10:44

    > Patch Set 4: Verified-1 Code-Review-1 > > Ok, checked the patch and we actually have a conceptional issue here that is not in line with how ckeditor should be configured. The problem is in the initial implementation and the assumption that external plugins actually have a configuration outside the editor config and that the name is always identical to the plugin name. The configuration for a plugin can be chosen by the plugin developer and does not need to follow any naming scheme. Adding an underscore does not help in this case since it will break current installations with custom plugins and is not a solution. We need to provide a workaround for this. I will provide a dedicated patch for this that is mitigating the issue. In the long run we should deprecate the config settings in the externalPlugins section and move it to editor.config as intended. I see. The issue encountered in the forge ticket was a misunderstanding. The user tried to enable the "language" plugin (which is a core ckeditor plugin) by adding it to editor.externalPlugins In fact, he just need to add it to editor.extraPlugins. So, could we just stop auto-registering editor.externalPlugins' config inside editor.config, an tell externalPlugins plugin's authors to just add their configuration inside editor.config, preferably with a namespace (like quicktable.js does) ?
  20. Benjamin Kott commented on patch set 4 01/21/20, 11:31

    The magic that is happening for external plugin configuration was "intended" for route resolving. It was later also partly used for general plugin configuration (external developers). This concept works as long as your plugin key is unique and does not conflict with existing/reserved keywords. The language problem we are now running into is describing exactly this case. There is a reserved keyword that is matching the plugin key, and we override by default even if the config is empty the key within the editor config. (In this case "editor.config.language" will be unsetted). As you noted, there are several ways for authors of plugins to fetch configuration. The assigned config key for the language plugin is for example "language_list" and not "language". For quicktable you have instead of one, multiple within "editor.config" (qtRows, qtColumns, qtClass, qtPreviewSize, qtPreviewBorder, qtPreviewBackground). There is no fixed schema for plugins, that also means for us we should stop guessing that there is a namespace/rules, and simply do not pass config from external plugin configuration to "editor.config" aside from the route resolving.
  21. Benjamin Kott commented on patch set 4 01/21/20, 11:34

    The solution to this problem has 2 elements. 1. Do not write empty configuration from external plugins to editor.config 2. If a configuration exists, provide a method to change the key that will be used within editor.config https://review.typo3.org/c/Packages/TYPO3.CMS/+/63004
  22. Rémy DANIEL abandoned the change 02/17/20, 17:49