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.
Add support for ckeditor 4.x
Comment | File | Size | Author |
---|---|---|---|
#4 | footnotes-n2025027-4.patch | 13.12 KB | DamienMcKenna |
#1 | footnotes-support_ckeditor_4x-2025027-1.patch | 10.46 KB | acrollet |
Comments
Comment #1
acrollet CreditAttribution: acrollet commentedOof, I was working on a patch for this last night/this morning as well - hey ho for duplicated effort. Anyway, I took a bit different approach, in that I created a separate directory for the 4-compatible version of the plugin, and added a test in hook_ckeditor_plugin() to use it if the ckeditor major version is > 3.
Patch attached for review, we may want to combine code/approaches.
Comment #2
reptilex CreditAttribution: reptilex commentedI managed to get it to work perfectly with ckeditor 4 with one addition to the patch posted by R.Muilwijk.
I had to add a "$plugin['footnotes']['load'] = 1;" to the if clause.
It seems the structure of the footnotes wysiwyg module has changed so this ist the way the file looks now:
Comment #3
DamienMcKennaThis needs work, at the very least the patch needs to be updated to Drupal's coding standards.
Comment #4
DamienMcKennaA rerolled version of R.Muilwijk's patch.
Comment #5
DamienMcKennaBTW the patch in #4 has to be applied with "git apply" instead of the usual "patch -p1" because the image is attached inline.
Comment #6
DamienMcKennaFYI the patch appears to work correctly with CKEditor v4.4.6, I think replacing the existing CKEditor v3 handler is a reasonable approach given that it's no longer supported.
Comment #7
zwerg CreditAttribution: zwerg commentedBoth patches are not working for me. Is it possible to upload the patched files (for CKEditor v3 and v4)?
Thanks in advance!
Comment #8
rbroberts CreditAttribution: rbroberts as a volunteer commentedFootnote mostly works. So long as you don't enable the plugin it works. After poking around in the debugger, here's what I've found.
To get the plugin working, you need to edit footnotes/footnotes_wysiwyg/ckeditor_plugin/plugin.js and change editor.addCss to CKEDITOR.addCss. That's it.
If you really need to support both v3 and v4 of ckeditor (never mind v5), you'll have to play some games with pulling the version number like the ckeditor module does.
Comment #9
rbroberts CreditAttribution: rbroberts as a volunteer commentedOkay, I'm going to take that back. While that seems to make it work, you have to have a pretty loose definition of work. While the first footnote added this way was just fine, when I went back to edit the page and insert a second footnote, the first one got trashed.
So don't enable the plugin in the ckeditor config, and just use the filter for
[fn][/fn]
Comment #10
pifagorComment #11
MichelleFYI, the latest dev snapshot on the 3.x branch works with CKEditor 4.x with no patch needed.
Comment #12
scott_euser CreditAttribution: scott_euser as a volunteer and at Soapbox Communications Ltd commented