Problem/Motivation
After #3231327: Plugin definition DX: validate ckeditor5.drupal.elements items and #3228505: Plugin definition DX: automatically check for plugin definitions whether their ::getDefaultSettings() matches the config schema, this still remains.
This would also help address #3246246: CKEditor 5 plugins needing more complex conditions.
Add validation ensuring that the values in CKEditor 5 plugin definition's drupal.conditions key are supported.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3248188-12.patch | 8.25 KB | bnjmnm |
Issue fork drupal-3248188
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 9.3.x
compare
- 3248188-plugin-definition-dx
changes, plain diff MR !1411
1 hidden branch
Issue fork ckeditor5-3248188
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3248188-plugin-def-validate-conditions
changes, plain diff MR !157
Comments
Comment #3
wim leersComment #4
wim leersComment #5
wim leersComment #6
bnjmnmThis is a good addition. The CKEditor 5 learning curve is going to be rough for most contributors, so anywhere we can catch clearly-incorrect config and provide useful guidance is great. It appears the test coverage accounts for all scenarios too.
I had some phrasing suggestions but other than that it's something I'd RTBC.
Comment #7
wim leersComment #10
wim leersAddressed all of @bnjmnm's feedback in https://git.drupalcode.org/issue/ckeditor5-3248188/-/tree/3248188-plugin..., then ported it verbatim to https://git.drupalcode.org/issue/drupal-3248188/-/tree/3248188-plugin-de..., followed by me closing the first one.
Comment #12
bnjmnmPatch to simplify this being added to multiple versions.
Comment #13
wim leers🙏
Comment #14
bnjmnmAll my feedback was addressed a while back apparently! This is a useful additional layer of validation that does a good job explaining exactly what is needed to address a given error.
Comment #15
wim leers🥳
Comment #19
lauriiiCommitted e264ec6 and pushed to 10.0.x. Also cherry-picked to 9.4.x and 9.3.x because CKEditor 5 is experimental. Thanks!
Comment #21
krzysztof domańskiUnfortunately, I noticed incorrect validation messages on several separate websites. As a result, the content editing page does not work.
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "ckeditor5_globalAttributeDir" CKEditor 5 plugin definition has a "drupal.conditions" value that contains some unsupported condition types: "filter". Only the following conditions types are supported: "toolbarItem", "imageUploadStatus", "filter", "requiresConfiguration", "plugins". in Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition->validateDrupalAspects() (line 224 of /core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php).The validation message on the one hand informs that the 'filter' type is incorrect. And on the other hand it indicates the 'filter' type as correct. This type is on the list of permitted parameters. So we are dealing with an error in the validation itself, here.
See #3503188: The "ckeditor5_globalAttributeDir" CKEditor 5 plugin definition has a "drupal.conditions" value that contains some unsupported condition types: "filter"