- Issue created by @joseph.olstad
- Status changed to Postponed
over 1 year ago 12:47am 26 May 2023 - ๐จ๐ฆCanada joseph.olstad
blocked on โจ ckeditor 4 and ckeditor 5 support simultaneously? Fixed
- ๐จ๐ฆCanada joseph.olstad
perhaps the easiest way would be to fork the 2.x version of this project into a ckeditor4_codemirror project and install both this module for ck5 and the forked one for ck4 at the same time.
This would be the easiest thing to try first! I will try this soon hopefully!
- Assigned to joseph.olstad
- ๐จ๐ฆCanada joseph.olstad
I'll get to this hopefully in the next 72 hours
- ๐จ๐ฆCanada joseph.olstad
https://www.drupal.org/project/ckeditor4_codemirror/releases/1.0.0-alpha1 โ
it's working but I'll polish it up soon, needs likely manual path renames and path fixing for the libraries
- ๐จ๐ฆCanada joseph.olstad
Drupalcon 2023 contribution, ckeditor4_codemirror
- Status changed to Active
over 1 year ago 1:07am 12 June 2023 - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:02pm 12 June 2023 - ๐จ๐ฆCanada joseph.olstad
Might also need something in site-wxt, hoping @smulvih2 can review this.
- ๐จ๐ฆCanada joseph.olstad
Hmm, this isn't quite ready, when using ckeditor 5 and ckeditor 4 at the same time and installing ckeditor4_codemirror ^1 and ckeditor_codemirror ^3 , ckeditor5 will crash and not load, some js errors, some sort of conflict to resolve.
- ๐จ๐ฆCanada joseph.olstad
โจ ckeditor 4 and ckeditor 5 support simultaneously? Fixed
and
- Assigned to joseph.olstad
- Status changed to Active
over 1 year ago 8:24pm 11 July 2023 - Status changed to Closed: won't fix
over 1 year ago 5:07pm 28 July 2023 - ๐จ๐ฆCanada sylus
I talked with @smulvih with this and I think to limit the maintenance and potential problems we just want to go pure CKeditor 5 and address any problems as they arise.
I believe we are close for Drupal 10 and this should be feasible for CKEditor 5.
I hope this is ok any makes sense although I appreciate that this issue was filed so others know they can do both should they choose.
- Status changed to Needs review
over 1 year ago 5:42pm 11 August 2023 - ๐จ๐ฆCanada sylus
Ok @smulvih2 talked to me a bit more and I think we agreed that sadly this is probably the best way forward to get people on Drupal 10, and push any content issues in CKEditor 5 to a later release. All of our plugins do work in both CKEditor 4 and 5 except for codemirror in CKEditor 4 which this ticket addresses.
As long as we set a timebox and don't end up support CKEditor 4 for longer then we should then I'm ok with this. :)
- ๐จ๐ฆCanada joseph.olstad
ckeditor4_codemirror is working well for us, I updated the installation instructions on the project page.
I will have to double check again to see how well it's working in harmony with ckeditor 5
- Status changed to Needs work
over 1 year ago 6:04pm 11 August 2023 - ๐จ๐ฆCanada smulvih2 Canada ๐
I was able to get working in CKE4, but get an error in console for CKE5:
CKEditorError: plugincollection-soft-required {"missingPlugin":"SourceEditing","requiredBy":"SourceEditingCodeMirror"}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#erro...I just added the following to the require section of composer.json, didn't have to use the merge plugin:
"drupal/ckeditor4_codemirror": "^1.0", "w8tcha/ckeditor-codemirror": "^1.16"
- Status changed to Needs review
over 1 year ago 6:29pm 11 August 2023 - ๐จ๐ฆCanada smulvih2 Canada ๐
I was able to get codemirror working with cke4/cke5 simultaneously, patch attached. I was getting the error when the Source button is not added to CKE5. Once I added the Source button to my new CKE5 text format it works as expected. I can toggle content between CKE4 and CKE5 and get codemirror in both.
Would like to run some more tests against this, like upgrading D9->D10, and fresh install of D10.
- ๐จ๐ฆCanada joseph.olstad
ok so I just re-tested ckeditor4_codemirror on a wxt5/D10.0.10 site that has ckeditor 4 , I enabled the ckeditor 5, configured a new text format with ckeditor5 as a wysiwyg
both code mirror in ckeditor 4 and code mirror in ckeditor 5 are working this way.
The way to make this happen is to install and set up the ckeditor4_codemirror module according to the project page installation instructions https://drupal.org/project/ckeditor4_codemirror
This way both ckeditor4 AND ckeditor 5 are able to work correctly with code mirror no conflicts.
I forked the ck4 ckeditor_codemirror branch over into a new project, massaged everything and it's tested , success.
no conflicts with ckeditor_codemirrorInstall and configure ckeditor4_codemirror
1. Download and install CKEditor4 CodeMirror module.
composer require drupal/ckeditor4_codemirror
2. Install the CKEditor-CodeMirror-Plugin library
For Composer-managed Drupal installations, the recommended method is to use
the Composer Merge Plugin and this module's composer.libraries.json file. From a Composer project root:
a) Execute
composer require wikimedia/composer-merge-plugin
.Add the following to the extra section of the root composer.json
file:
"merge-plugin": { "include": [ "{DOCROOT}/modules/contrib/ckeditor4_codemirror/composer.libraries.json" ] },
Note: Remember to replace
{DOCROOT}
with the appropriate root folder for the Drupal installation -- this is likelyweb
or docroot orhtml
.c) Execute
composer install
(or, in some cases, composer update --lock).d)
composer require "w8tcha/ckeditor-codemirror":"*"
Post-Installation
- Go to "Administration ยป Configuration ยป Content authoring ยป Text formats and editors" (admin/config/content/formats) page.
- Click "Configure" for any text format using CKEditor as the text editor.
- Under "CKEditor plugin settings", click "CodeMirror" and check "Enable CodeMirror source view syntax highlighting". Make sure that the current toolbar has the "Source" button. Adjust other settings as desired.
- Scroll down and click "Save configuration".
- Go to node create/edit page, choose the text format with CodeMirror plugin. Press the "Source" button.
- ๐จ๐ฆCanada joseph.olstad
@smulvih2 , I was saving my comment after you put yours in,
yes that plugin and module does the trick, no conflict!
- ๐จ๐ฆCanada smulvih2 Canada ๐
Yep, and don't need the merge plugin to get working. If you were to add "w8tcha/ckeditor-codemirror" to the composer.json for your module then only one require would be needed for WxT. I added a patch for this here - https://www.drupal.org/project/ckeditor4_codemirror/issues/3380761#comment-15189687 โจ Require w8tcha/ckeditor-codemirror Needs review
- ๐จ๐ฆCanada sylus
I got this working and am now calling @joseph drupal module, but for the w8tcha/ckeditor-codemirror I just added it to composer-extdeps as we did for the earlier version to keep things clean. I also took the 1.18.5 version of codemirror which is closer to what we are shipping supporting "codemirror": "^5.65.5"
- ๐จ๐ฆCanada joseph.olstad
ya whatever works, as long as it works and looks good, great :)
That merge plugin is from the ckeditor_codemirror instructions, maybe we already have something similar or that functionality is included now in composer by default, not sure. - ๐จ๐ฆCanada joseph.olstad
Wow thanks @smulvih2 for the patch , I'll make a new release of ckeditor4_codemirror with patch from @smulvih2
โจ Require w8tcha/ckeditor-codemirror Needs reviewnew release coming right up
- ๐จ๐ฆCanada joseph.olstad
ok this simplifies the require process, let me know how this works for you @smulvih2
-
sylus โ
committed 122c2712 on 5.0.x authored by
joseph.olstad โ
Issue #3362801 by joseph.olstad, smulvih2: [D10] - codemirror support...
-
sylus โ
committed 122c2712 on 5.0.x authored by
joseph.olstad โ
- ๐จ๐ฆCanada joseph.olstad
Ok I'll publish release 1.0.2 right away that will specify the
^1.18.5
version of the library instead of^1.16.0
This way it should avoid a conflict when doing
composer up
- ๐จ๐ฆCanada sylus
I think you need to revert the patch that @smilvih provided in the other repo since this only works in wxt because that version and others is defined in composer-extdeps.
How your module worked before is the correct way for people using the merge plugin, we just don't need it because we have our own composer registry which push this stuff but others won't have that.
https://github.com/drupalwxt/composer-extdeps/commit/ea80c3339ff6da7bb84...
- Status changed to Fixed
over 1 year ago 7:15pm 11 August 2023 - ๐จ๐ฆCanada sylus
So just revert this:
https://www.drupal.org/project/ckeditor4_codemirror/issues/3380761 โจ Require w8tcha/ckeditor-codemirror Needs review
But then in your composer.libraries can update to 1.18.5 if want to target close to the codemirror library. :D We use.
Closing this issue out :)
Committed and attributed!
- ๐จ๐ฆCanada joseph.olstad
@sylus, ah oops ok I'll revert and re-tag, thanks for the heads up
Automatically closed - issue fixed for 2 weeks with no activity.
- Issue was unassigned.
- Status changed to Fixed
12 months ago 9:55pm 9 January 2024