Using D9.0.3
php error when installing footnotes:
User deprecated function: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_footnote_link(). See https://www.drupal.org/node/1831138 in Drupal\Core\Theme\Registry->processExtension() (line 498 of core/lib/Drupal/Core/Theme/Registry.php).
Drupal\Core\Theme\Registry->processExtension(Array, 'footnotes', 'module', 'footnotes', 'modules/contrib/footnotes') (Line: 341)
Drupal\Core\Theme\Registry->build() (Line: 240)
Drupal\Core\Theme\Registry->get() (Line: 88)
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | code_3169299-26.png | 131.35 KB | kleiton_rodrigues |
| #26 | site_3169299-26.png | 25.09 KB | kleiton_rodrigues |
| #25 | interdiff-3169299-23-25.txt | 731 bytes | scott_euser |
| #25 | footnotes-drupal9-theme-functions-3169299-25.patch | 6.07 KB | scott_euser |
| #23 | drupal9_compatible-3169299-23.patch | 6.32 KB | szds |
Issue fork footnotes-3169299
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
Yuri commentedComment #3
Yuri commentedsetting to Major because this error prevents database updates
Comment #4
phjouI confirm this bug, lots of warnings in the logs everytime you load a ckeditor.
Comment #5
phjouOk I think I did the minimal patch needed to fix this. The generation of the HTML that is spit for the list seems pretty old school php but I didn't want to touch that part to avoid regressions. It probably should be done in a different issue after this one.
Let me know if this patch works for you. It seems ok for me on Drupal 9.
Comment #6
AnticoVeneziano commentedhi,
thanks! but
the patch cleaned the warnings, but sadly now all the html tags appears in the footnotes...
Comment #7
AnticoVeneziano commentedhi,
on localhost everything works fine with the same website, and also with a simple installation of drupal 9...
online warnings (without patch) or tags exposed (with patch)...
Comment #8
xmacinfoComment #9
cestmoi commentedsame as in comment #6 but it's happening on localhost and haven't tested online. The patch makes the module useless this way unfortunately. on Latest drupal 9.1.2
Comment #10
xmacinfoComment #11
baluertlComment #12
baluertlAlso important to check whether CKEditor loads properly on
/node/add/pageand/node/{NID}/editpages? For me enabling the patched Footnotes module breaks WYSIWYG functionality by some strange reasons.Comment #13
szds commentedHere is a patch for the version 8.x-2.1 which is tested to work for D9.1.3 .
Comment #14
xmacinfoLooks like tabs instead of spaces.
Comment #15
szds commentedSimilar to patch in #13 with array() changed to [] and tabs replaced with spaces. Tested for D9.1.3 for add/edit nodes and CKEditor.
Comment #16
xmacinfoComment #17
cestmoi commentedThe patch in #15 got rid of the warning and everything looks fine except for when the footnote has any html it's then exposed in the footnote text display. Otherwise, the list and numbering seems fine.
Tested locally for D9.1.4 for add/edit node and CKEditor
Comment #18
szds commentedHTML in the footnotes is an interesting use case. In the source you have to add html within the
<fn></fn>tags. For the CKEditor the Source button has to be available.You can render HTML by using the raw filter in the twig file. In general, this is not the best approach. At least for the CKEditor, XSS can be avoided by ensuring that the Text format filters out some tags (e.g. script tag).
Here is a patch that allows the rendering of HTML in the footnotes. It differs from the patch in #15 only by adding the raw filter to the footnote-list.html.twig file.
Comment #19
cestmoi commentedThe last patch in #18 is working great now. Tested with html in footnote text and all looks great now. Thanks @szds
On latest Drupal 9.1.4 and Footnotes 2.x-dev
Comment #20
xmacinfoLet's see if tests are passing on D9.1.
Comment #21
cestmoi commentedThe patch test is failing I think due to the version patch in .info which is not needed as this module dev version is already converted to D9.
I just removed the patch part for the .info file and let's re-test it
Comment #22
xmacinfoComment #23
szds commentedHere is the patch for the dev version 8.x-2.x-dev
This also fixes the issue (3195978) wherein the footnotes list currently can only be placed at the default location at the end of the node; adding a placeholder [footnotes] or [footnotes /] or
<footnotes>, within the content adds the footnotes list but removes the text subsequent to the location of the placeholder.Comment #24
xmacinfoComment #25
scott_euser commentedJust a quick fix to coding standards indentation, but otherwise this works well for me in Drupal 9, gets rid of deprecation notices + nicely allows better theme control over the output, so win win, thanks! RTBC from me (but since the coding standards change, will leave at NR).
Comment #26
kleiton_rodrigues commentedTested your patch looks good to me...
thanks!
RTBC +1
Comment #28
pifagorThanks,fixed