Problem/Motivation
@nod_ found a hard blocker in #3263384: Add ckeditor5-code-block package and CodeBlock plugin: the CKE4 Format
toolbar button (dropdown, really) is already mapped to CKE5's heading
. This means it's impossible to also map it to codeBlock
.
Worse, blindly mapping Format
to heading
is wrong too: if no <h*>
tags are allowed in a text format, then it also does not appear in the Format
dropdown:
Compare this with the case where <h*>
and <pre>
are allowed:
Steps to reproduce
See above.
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
None.
API changes
TBD
Data model changes
None.
Release notes snippet
One of the methods on the CKEditor 4-to-5 upgrade plugin interface was made more capable: CKEditor4To5UpgradePluginInterface::mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem()
. In doing so, a small backwards compatibility break was introduced. This was considered acceptable given zero real-world usages of this (very new) interface exist.
Comment | File | Size | Author |
---|---|---|---|
#23 | 3268174-23.patch | 21.76 KB | Wim Leers |
| |||
#23 | interdiff.txt | 853 bytes | Wim Leers |
#17 | 3268174-17.patch | 21.54 KB | Wim Leers |
| |||
#17 | interdiff.txt | 9.65 KB | Wim Leers |
#14 | 3268174-14.patch | 18.99 KB | Wim Leers |
|
Issue fork drupal-3268174
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:
Comments
Comment #2
Wim LeersComment #4
Wim LeersComment #6
nod_RTBC, just a very minor readability concern
Comment #7
Wim LeersComment #8
Wim LeersUgh — PhpStorm is making my computer lag so much that both the commit and the #7 patch are missing a semi-colon…
Comment #9
lauriiiSeems fine to add this to the API since this is something is useful to be able to check 👍
Seems fine since this is all internal. 👍
Could there be wildcards like
<h*>
?Wondering about the new argument being optional. Since it's required for some plugins, shouldn't we have it as a required argument even though that would be a BC break?Ahh I see, it is marked as required here 🤔 I guess this is better for BC reasons + this should be only called by
\Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginManager
.🥲
Comment #10
nod_wildcards are only for attributes names or values no? using them in tag names triggers a JS error at least on 10.x so not sure it's supposed to work
Comment #11
nod_Looking at the php doesn't seem like
<h*>
is a valid config.Comment #12
Wim Leers#9.5: yep, exactly! I wanted to verify that this actually works though:
and that fails like this:
(See https://3v4l.org/trPZF.)
Looks like we have to rethink this. I don't see how we can do this without breaking BC? OTOH, we are HIGHLY confident that nobody in the world has implemented CKEditor 5 upgrade path plugins yet. So … I think a BC break may be acceptable in this one case?
Comment #13
catchIf we're confident that no-one is implementing the interface yet, I think we should just go ahead and break it (with a release note and CR) before anyone does. ckeditor5 is still experimental and this is required to fix a critical bug.
Comment #14
Wim Leers@catch: Alright, thank you! 👍
FYI: @nod_ also double-checked the Drupal contrib scanning site and found zero implementations of this 👍
Here's then a reroll that fixes the problem described in #12 and technically introduces a BC break. Created a change record too: https://www.drupal.org/node/3269438
Comment #15
nod_code-wise it's good with me. I'll let framework managers greenlight it, or not :D
Comment #16
lauriiiSince we are introducing changes to the interface, should we change the return type to an array to properly support this use case?
Comment #17
Wim Leers#16: I think that makes sense! (And coincidentally it makes all
CKEditor4To5UpgradePluginInterface
methods consistent in their return type.)CR updated too.
Comment #18
catchStill needs a release note. Also tagging for all three branches.
Comment #19
Wim LeersProposed release note snippet added.
Comment #20
catchThis is confusing with the double negative, could it use isEmpty or isEmptySet or similar instead?
Comment #21
lauriiiI personally think unrestricted makes the most sense it's a term that's already being used in Editor and CKEditor 5. This is specifically trying to explain why the restriction set is empty - is it because nothing is allowed or because everything is allowed.
Comment #22
catchI think we need something better than "Whether this set of restrictions is unrestricted." for the comment then.
Comment #23
Wim LeersImproved comment:
Comment #25
Wim LeersRandom unrelated failure on
10.0.x
branch only:Re-testing, re-RTBC'ing.
Comment #29
catchOK that reads a lot better, I changed 'f.e.' to 'e.g.' on commit.
Committed/pushed to 10.0.x, 9.4.x, and 9.3.x, thanks!
Comment #31
xjmGiven that this was backported to 9.3.x for a release note about a technical BC break, I don't think we don't need to mention it in the 10.0 and 9.4 release notes. It's a very small change from 10.0.0-alpha2 compared to the many significant BC breaks from major dependency updates and deprecation removals for things that were not deprecated until this month, and 9.4.x has never had a tagged release.