- First commit to issue fork.
- @praveenpb opened merge request.
- ๐ฎ๐ณIndia praveenpb Bangalore
Created a patch and MR for the ckeditor5 compatibility.
- Status changed to Needs review
about 2 years ago 7:26pm 19 February 2023 - ๐ฎ๐ณIndia praveenpb Bangalore
Created a patch and MR for the ckeditor5 compatibility.
- ๐ซ๐ทFrance prudloff Lille
The upcast in #22 is not working correctly. It creates empty
FootnotesValue
elements in the data model and those are not displayed.
I updated the patch to createFootnotesValue
element with a text content and now they are correctly displayed in the editor.However, I am not entirely sure why there is both the
FootnotesValue
andFootnotes
elements, because onlyFootnotesValue
elements seem to be actually used in the data model. - ๐ฎ๐ณIndia praveenpb Bangalore
@prudloff, Thanks for updating the patch.
I thought to add support for footnotes which doesn't have value attribute(added in ckeditor4) so added Footnotes and FootnotesValue. But you might be right we can get rid of one of them.Updated the MR and the patch accordingly.
- ๐บ๐ธUnited States scottop
I have a new project in Drupal 10 that needs footnotes. The "Drupal 10 compatibility" patch ( 3343180 ๐ Drupal 10 compatibility Fixed ) was for version 3.0.1 (and worked). This patch does not work on that version, I assume because it was made to patch version 3.0 (Composer just gave up). Is there a chance to get this patch rolled into the Drupal 10 compatibility?
- ๐ช๐ธSpain idiaz.roncero Madrid
@scottop I just tried to apply both this patch and the D10 Compatibility, and for me are working with the latest 3.0.x version of footnotes.
They apply, but the order is important: Cke5 first, then D10. Maybe is this what is failing on your install?
"drupal/footnotes" : { "3252524 - Updated with ckeditor5 compatibility." : "https://git.drupalcode.org/project/footnotes/-/merge_requests/4.patch", "3343180 - Drupal 10 compatibility" : "https://www.drupal.org/files/issues/2023-03-08/footnotes-d10-compatibility-3343180-5.patch" },
- ๐บ๐ธUnited States scottop
@idaz.roncero I had tried the ordering, but I was using the patch from #24. I noticed that you used the patch from the Git repository #5. It works with that patch, but not with the one from #24 here.
The problem is, when I use your patch and try to enable it, it still requires CKEditor 4 and asks me to Download the FakeObjects module and put it in the /libraries folder. I don't think Drupal 10 has a /libraries folder anymore, or at least I don't since I let it set up the new structure with just /vendor and /web folders at the top level, and will I be able to disable CKEditor 4 later?
- ๐ฆ๐บAustralia sonnykt Melbourne, Australia
Patch #24 cannot apply to Footnotes 3.0.1.
- ๐บ๐ธUnited States scottop
So, can I use Footnotes in Drupal 10? It seems that patch 5 didn't quite work, and thus the need for patch 24, but only Footnotes 3.0.1 is compatible with Drupal 10.
- ๐บ๐ธUnited States hyperlogos
See #26, put that snip into patches under extras in composer.json.
then composer require cweagans/composer-patches
then composer require 'drupal/footnotes:^3.0'
The UI is a bit messed up for me but the functionality seems to be working, kind of. Also, HTML footnotes are not rendered in HTML, the tags are just stripped, and I'm not sure the right things are happening with styles either. But it is possible to create footnotes, and have the list render at the bottom of the display. I cannot edit them except by going to source view.
- ๐บ๐ธUnited States scottop
hyperlogos,
Thanks for the response. I do that, and I still have the error message when I go to enable the module:
Error message Before you can use the FakeObjects module, you need to download the plugin from ckeditor.com and place it in /libraries/fakeobjects. Check the README.txt for more information. Get the plugin here. (Currently using FakeObjects version Plugin not detected)
So, as I said above, I have a fresh Drupal 10 install, and we no longer seem to have a /libraries folder. At the top level, I only have two folders, "vendor" and "web". Or, perhaps I just ignore the error?
- ๐บ๐ธUnited States hyperlogos
the fakeobjects library goes into libraries/fakeobjects in your web directory. you will unpack the zip in web/libraries and then rename it from fakeobjects-version to fakeobjects
- ๐ฌ๐งUnited Kingdom catch
Does the ckeditor5 version actually require fakeobjects though? If not then that message should be conditional on the ckeditor4 module being installed.
- ๐ฉ๐ชGermany franz-m
ckeditor5 has fakeobjects as dependency.
But then, fakeobjects has ckeditor4 as dependency, so it automatically gets required on D10 on enabling footnotes :(.
As far as I remember, ckeditor5 possibly needs ckeditor4 to import earlier texts on migration.
Nevertheless, I edited fakeobjects dependency to drop ckeditor4. I'll see how my migrations (D6 .. D10) will do. - ๐จ๐ฆCanada dylan donkersgoed London, Ontario
Dylan Donkersgoed โ made their first commit to this issueโs fork.
- ๐จ๐ฆCanada dylan donkersgoed London, Ontario
The CKE4 version of this plugin used to display footnotes as [fn] rather than showing them inline. I've updated the CKE5 plugin to behave in a similar way and pushed it to the MR. I've attached a patch as well.
- ๐จ๐ฆCanada dylan donkersgoed London, Ontario
The old version also allowed editing footnotes by clicking them, I've added that to the new version as well. Updated patch attached and it's in the MR.
- ๐จ๐ฆCanada dylan donkersgoed London, Ontario
The old footnotes widget supported entering the footnote text in a text area, but it was a single line input in the new one. This made editing long footnotes much harder. I've pushed up another change to switch the footnote text input back to a text area and enlarge it. Patch is attached.
- ๐ซ๐ทFrance everhee
Last patch is very good. Is there any way that footnotes created with ckeditor 4 might be compatible to ckeditor 5 when switching the text format ?
- ๐จ๐ฆCanada dylan donkersgoed London, Ontario
@everhee That should be working already. The new CKE5 plugin does store them in a different format, but it's supposed to load the child content of old tags into the value attribute of new ones. Is that not working for you and if so could you provide some sample markup with the issue?
- ๐จ๐ฆCanada dylan donkersgoed London, Ontario
@everhee Nevermind, I see the issue and have pushed up a fix to the MR. New patch attached as well.
- last update
over 1 year ago run-tests.sh fatal error @Franz-m how did that โจ Support for ckeditor 5 Fixed end up for you ?
Do you have ckeditor4 installed despite the core ck5 being there :-?
This whole chaos/dilemma about D10/Ckeditor5 .. fakeobjects/ck4 seems to not be addressed by anyone yet so we get a working D10 compatible version without the need for the ckedtior4 anymore.- ๐ฌ๐งUnited Kingdom catch
There's a separate issue with a patch for the fakeobjects dependency here: ๐ Remove Fakeobjects as hard dependency Fixed .
PHP Fatal error: Declaration of Drupal\Tests\footnotes\FunctionalJavascript\FootnotesCkeditorPluginTest::setUp() must be compatible with Drupal\Tests\BrowserTestBase::setUp(): void
Test error above looks like an easy fix.
@catch thanks, I tried this and it didn't work and I guess it's because I have core CKE5 enabled and I don't want to uninstall it. This also doesn't address what should be the main issue worked on for footnotes i.e. a D10 compatible footnotes module that takes into account that fakeobjetcs is dependent on cke4 when core D10 already has cke5 with fakeojects plugin already there.
Different issues each working on one aspect but no one is taking ALL these considerations together especially now that D9 is near its EOL!- ๐ฌ๐งUnited Kingdom catch
@cestmoi it's not clear if you mean this patch didn't work, or the patch on ๐ Remove Fakeobjects as hard dependency Fixed didn't work, if you mean the fakeobjects issue, it would be better to report anything over there.
- last update
over 1 year ago run-tests.sh fatal error @catch thank you. For some reason installing the footnotes module after applying all 3 patches (D10, CKE5, and Fakeobjects) threw a php error when I did the install via drush but all went fine when I installed the module via drupal admin UI. I have the core CKeditor5 enabled, CKE4 and Fakeobjects modules removed, and footnotes filter enabled and it seems to be working as expected per my testing so far, and no errors.
-
smulvih2 โ
committed e69f468e on 3.1.x authored by
Dylan Donkersgoed โ
Issue #3252524 by praveenpb, Dylan Donkersgoed, jozl05, Johnzel Tuddao,...
-
smulvih2 โ
committed e69f468e on 3.1.x authored by
Dylan Donkersgoed โ
- ๐จ๐ฆCanada smulvih2 Canada ๐
I tested patch #41 and it works great! I have a D10 sandbox and with this patch I can insert and manage footnotes in both CKE4 and CKE5. This has been merged with the 3.1.x branch for testing. We can handle any issues in a separate ticket.
The 3.1.x branch also includes some updates for the CKE4 plugin that would be good to roll into the CKE5 plugin, but we can do that as part of a separate ticket:
- Fn value in the backend - https://www.drupal.org/project/footnotes/issues/3119883 โจ Fn value in the backend Fixed
- Enable CKEditor basic styles for footnote text field - https://www.drupal.org/project/footnotes/issues/3204959 ๐ Enable CKEditor basic styles for footnot text field Fixed
- Status changed to Fixed
over 1 year ago 4:13am 4 August 2023 Automatically closed - issue fixed for 2 weeks with no activity.