Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
With CKEditor 4, Drupal core did not provide a code button, even if the HTML tag was accepted by default. T«
Steps to reproduce
- Install and enable the Codetag module.
- Add the codetag button to a CKEditor-enabled text format.
- Attempt to upgrade from CKeditor (4) to CKEditor 5.Also, notice the error that the button is not added.
- With proosed fix, switching from CK4 to CK5 does not trigger warning, and the button is present in the same location in the toolbar.
Proposed resolution
Replace code with core's CK5 code button.
Remaining tasks
Add the upgrade path.
User interface changes
None.
API changes
New Contrib upgrade class for CK4 -> CK5 plugins
Comment | File | Size | Author |
---|---|---|---|
#17 | 3274278-17.patch | 5.14 KB | Wim Leers |
| |||
#17 | interdiff.txt | 1.89 KB | Wim Leers |
#16 | Screen Shot 2022-04-13 at 1.14.59 PM.png | 361.38 KB | bnjmnm |
#13 | 3274278-13.patch | 3.11 KB | Wim Leers |
| |||
#13 | interdiff.txt | 1.26 KB | Wim Leers |
Comments
Comment #2
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #3
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #4
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedProviding a class that upgrades the Codetag module to the one provided by core's CK5, and that can be used as base for other contrib modules to provide their own upgrade path.
Comment #5
yogeshmpawarResolved CSpell errors
Comment #7
andregp CreditAttribution: andregp at CI&T commentedSeems to be an unrelated feature, requeuing tests.
Comment #9
Wim LeersThanks for this great contribution and wonderful news, @jcnventura! Thanks for investigating! 😊🙏 Because this is de facto now upgrading the core upgrade path, because it must be Drupal core providing this upgrade path (since the equivalent CKE5 plugin of the CKE4 plugin is part of Drupal core now), bumping this to a stable blocker.
Indeed unrelated failure. Re-queueing.
Note that this will need tests. I'll work on those.
Comment #10
Wim LeersTests. :) Test-only patch is also the interdiff.
(And limiting test runs for both to only CKE5 tests.)
Comment #12
Wim LeersThat worked :)
Let's run all tests again, not just CKE5's.
Comment #13
Wim LeersI think we should delete this.
phpcs
dictates there must be at least onecase
. Well, that just means we can remove theswitch
statement.Same thing here.
Comment #14
andregp CreditAttribution: andregp at CI&T commentedManually tested patch #13
Steps I took:
I also checked the patch for spelling errors and coding standards. Everything was correct, only the method names on Contrib.php were not in lowerCamel format, but I see it was on purpose because of this module's name so it's RTBC for me.
+1 RTBC
Edit.: Please ignore the fourth file. I sent it by mistake.
Comment #15
Wim LeersGiven:
I think it's reasonable to RTBC this, despite my having contributed those 2 lines of code for the test coverage.
Comment #16
bnjmnmThis looks great!
I notice that even when the code plugin is enabled to support the switch from codetag, it's not included in the "The following plugins were enabled" message. It would be good to have that, or at the very least an explanation as to why it isn't included (much better to have though 🙂)
Comment #17
Wim LeersThat is intentional. We only generate such messages when there are additional plugins enabled compared to the CKEditor 4 configuration. In this case, the same exact functionality/button has an exact equivalent, so providing a message is not helpful.
If we'd change this then #3245967: Messages upon switching to CKEditor 5 are overwhelming would be even worse, and hence the
expected_messages
expectations in\Drupal\Tests\ckeditor5\Kernel\SmartDefaultSettingsTest::provider()
would increase by a lot.To prove this, I'm adding an explicit test case to
SmartDefaultSettingsTest
too, that is just like the others. Observe how in this case, the expected messages are indeed empty, but many test cases have theThe following plugins were enabled to support …
style message you were hoping for. Since this is again so trivial, I am comfortable self-RTBC'ing.Comment #18
alexpottCommitted and pushed 46903e6c3c to 10.0.x and 12e8b703f8 to 9.4.x and c94dc2dcc6 to 9.3.x. Thanks!