- 🇺🇸United States wells Seattle, WA
Due to the nature of the CKEditor plugins there won't be support for D10 in the 8.x-2.x branch.
- 🇺🇸United States justcaldwell Austin, Texas
Will you elaborate on this decision?
If the Update Bot is correct, the changes needed to support D10 in the 2.x branch are minimal, and CKEditor 4 will continue to be available in D10 as a contrib project → .
- Status changed to Needs work
almost 2 years ago 9:43pm 16 February 2023 - 🇺🇸United States wells Seattle, WA
Oops! I didn't think about the contrib project. Yes, we should support that and I assume will require more changes that just what Update Bot has given us here?
- 🇺🇸United States justcaldwell Austin, Texas
That's great news! I'll do some testing to try to sort out what's needed. Thanks.
- @justcaldwell opened merge request.
- @justcaldwell opened merge request.
- Status changed to Needs review
almost 2 years ago 8:11pm 20 February 2023 - 🇺🇸United States justcaldwell Austin, Texas
MR3 is pretty minimal. It applies the update bot patch (#3), allows composer/installers 1.0 or 2.0, and adds the drupal 10 core version requirement.
With those changes, I was able to manually test on a clean Drupal 10.0.3 instance, and everything works as expected. I'm not set up to run automated tests on D10 at the moment, and I seems like the tests above will only run against MR2, which I closed because I accidentally targeted the 3.x branch. Perhaps someone else could confirm the tests pass, or can figure out how to get the automated tests to use MR3? 🙏
Steps I used to install and test:
- Install CKEditor 4 - 1.0.1 → contrib project (CKE4 for D10), and enable it on at least one text format/editor
- Install the mglaman/composer-drupal-lenient if it's not already in your project.
- Add ckeditor_codemirror to the lenient allowed-list
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/ckeditor_codemirror"]'
composer require 'drupal/ckeditor_codemirror:2.x-dev@dev'
- Apply the MR3 patch
- Install
w8tcha/CKEditor-CodeMirror-Plugin
manually or as described on the project page. - Enable ckeditor_codemirror module and configure it for the text editor in step 1 above.
- 🇺🇸United States wells Seattle, WA
Thanks, @justcaldwell. This is looking the good.
The only part I remain unclear on is, do we need to make changes to ckeditor_codemirror.info.yml#L7 in support of the switch to contrib ckeditor? How does this work for supporting both pre-10 core version and post-10 contrib version?
- Status changed to Needs work
almost 2 years ago 8:42pm 21 February 2023 - 🇺🇸United States justcaldwell Austin, Texas
That's an excellent point! After digging a bit, it looks like there's some potential issues around this (see 🐛 Incorrect version of CKEditor being parsed from info.yml files Active and 🐛 The contrib ckeditor project is installed unexpectedly Closed: duplicate ).
I can tell you that I tested on Drupal 9.5, and it "just works" — that is, this issue branch works just fine in 9.5 regardless of which version of ckeditor 4 is installed, core or contrib. (In this case, I cloned the repo into the project, so I can't yet speak to what Composer might do.)
I assume this is the case because a contrib module is essentially able to stand in for a core module dependency, based on this comment from Wim Leers 🐛 The contrib ckeditor project is installed unexpectedly Closed: duplicate :
Drupal core specifically is designed to let a module named identically to a core module to completely override the core module.
At a minimum, since contrib ckeditor 4 is only works with Drupal 9.4+, the core version requirement would need to change to
^9.4 || ^10
.I guess another other option would be to release a separate D10 branch with an explicit dependency on contrib
ckeditor:ckeditor
?So, definitely some additional thinking is required here. To be honest, I'm thinking about dropping ckeditor_codemirror from our project until we can migrate to ckeditor5.
- 🇺🇸United States wells Seattle, WA
Yeah this is the headache I was worried about (:
I wonder if this has been asked about the in the Drupal Slack #ckeditor5 channel? If not we could ask about it there.
I would be fine with changing the core version requirement to
^9.4 || ^10
so it's just a matter of figuring out how to address the dependency...Do non-namespaced dependencies still work? I wonder if we could just set it
ckeditor
and that would work in both 9 and 10... - 🇺🇸United States justcaldwell Austin, Texas
Agreed — it's a bit of a pain.
I'm not sure whether dropping the namespace still works, but the
drupal:ckeditor
dependency worked fine in both 9 and 10 in my testing. Surprising, but I guess the contrib module is able substitute even in D10.For me, the primary unknown is if composer will get tripped up in a D9 project, since I didn't explicitly test a composer install on D9 (worked fine on D10). Some of the issues I reviewed mention people having composer-related problems. I'll try to carve out some time to test that this week.
- Status changed to Needs review
over 1 year ago 9:12pm 22 February 2023 - 🇺🇸United States justcaldwell Austin, Texas
I updated the MR with the
^9.4 || ^10
core version requirement, and installed with composer on both D9 and D10. It went great. I think the composer problems I'd seen in other issues were due to those modules having a hard dependencies on ckeditor in their own composer.json files.On Drupal 9, the issue branch installed with composer (using this method → ) and worked equally well with either core or contrib ckeditor.
On Drupal 10, when I installed
drupal/ckeditor_codemirror:^2.4
with composer (again, using the lenient plugin), it actually also installeddrupal/ckeditor
(contrib ckeditor 4) even though I didn't explicitly require it, nor is it required in the module composer.json file. So, it would seem that packages.drupal.org sees thedrupal:ckeditor
dependency in the info file and provides the contrib version to satisfy that—even though the namespaced depedency for the contib module would beckeditor:ckeditor
. Nice!A good next step might be to tag a pre-release (e.g. 8.x-2.5-beta1). That would allow for others to install and test without all the composer workarounds.
- 🇺🇸United States wells Seattle, WA
A good next step might be to tag a pre-release (e.g. 8.x-2.5-beta1). That would allow for others to install and test without all the composer workarounds.
Makes sense! Lets give it a go...
-
wells →
committed f7b8a7ad on 8.x-2.x authored by
justcaldwell →
Issue #3286480 by justcaldwell, Project Update Bot: Automated Drupal 10...
-
wells →
committed f7b8a7ad on 8.x-2.x authored by
justcaldwell →
- Status changed to Fixed
over 1 year ago 1:55am 23 February 2023 - 🇺🇸United States wells Seattle, WA
Alright 8.x-2.5-beta1 → is ready for testing!
- 🇺🇸United States justcaldwell Austin, Texas
Thanks @wells! Just a couple of quick follow-ups:
1) Now that I'm able to use the standard install method, composer downloads the contrib version of ckeditor when installing on Drupal 9. Seems to just be a fact of life for the Drupal ckeditor 4 ecosystem 🐛 Incorrect version of CKEditor being parsed from info.yml files Active for now and everything still works. There's a simple workaround for anyone who wants to avoid this—I'll open a separate issue to document that.
2) I think tests are going to fail in D10 since the 'stable' theme is no longer available. That just needs to be changed to 'stark'.
- 🇺🇸United States wells Seattle, WA
1) Now that I'm able to use the standard install method, composer downloads the contrib version of ckeditor when installing on Drupal 9. Seems to just be a fact of life for the Drupal ckeditor 4 ecosystem for now and everything still works. There's a simple workaround for anyone who wants to avoid this—I'll open a separate issue to document that.
It's interesting to me this is seen a problem... I figured this was a good/expected thing, hah. But yeah will add a release note with 📌 The contrib ckeditor project is installed unexpectedly Active .
2) I think tests are going to fail in D10 since the 'stable' theme is no longer available. That just needs to be changed to 'stark'.
I was thinking we would just rely on the 3.0.x branch for D10 but yeah I suppose some folks will want to update to D10 and keep ckeditor4 around with the 8.x-2.x branch. I almost don't want to support that but it is understandable.
- 🇺🇸United States justcaldwell Austin, Texas
I suppose some folks will want to update to D10 and keep ckeditor4 around with the 8.x-2.x branch
It's a temporary measure for us. We have a custom ckeditor4 plugin that still needs to be ported to ckeditor5. We'd like to get to Drupal 10 while that happens.
- 🇺🇸United States wells Seattle, WA
Alright we've got green tests on D9 and D10 now. Lookin' good...
Automatically closed - issue fixed for 2 weeks with no activity.