Problem/Motivation
The footnotes module will sometimes doulbe-generate the footnotes. For example, if you have the footnotes of:
1. foo
2. bar
What will generate is:
1. foo
2. bar
3. foo
4. bar
My team has done a few extensive deep dives in to drupal core and footnotes to try to identify the issue, but we've been unsuccessful in finding it so far.
From the comment in #8 it seems likely that this is related to using text format with summary, and the summary text containing the citations as well.
Steps to reproduce
My team notices this problem particularly with the use of paragraphs, and especially on Book content types. To see this for yourself:
- Install footnotes and paragraphs.
- Create a paragraph with a WYSIWYG text field with summary.
- Create a node that will accept multiple paragraphs, or add the paragraph field to the Book content type and allow it to accept multiple entries.
- Create an instance of the node, adding multiple paragraphs, and adding footnotes to each paragraph, ensuring the citations appear in the summary text as well.
Proposed resolution
Figure out how/when/where/why the footnotes are being allowed to duplicate Footnotes seem to be allowed to duplicate when they appear in the text summary (text format with summary type field).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | quick-fix-for-duplicate-footnotes-3428596-01.patch | 2.04 KB | emanaton |
Comments
Comment #2
emanaton commentedComment #3
chaseconklinI just ran across a very similar issue on the 4.x branch of the module. The patch seems to work on the 4.x branch as well.
Comment #4
scott_euser commentedThanks for flagging this, will try to get to reviewing this issue in the next few weeks. For now marking as needs work as it has a patch but I think we agree it is a bandage solution rather than solving the issue.
It would be helpful to know:
To make it easier to reproduce.
Thanks!
Comment #5
chaseconklinIn our case, it only happens when using the twig tweak block to group all of the footnotes. It happens regardless of using the js group option or not. It doesn't happen when we don't use the grouping option. Here is a list of the filters we're using
Comment #6
scott_euser commentedHmmm not able to reproduce in the 4x branch sorry - I am trying with clean install, enabled a series of filters, used paragraphs, added multiple footnotes within each paragraph, nothing repeated.
Comment #7
scott_euser commentedComment #8
chaseconklinI think I just found a way to replicate the bug. Here are the steps:
I'm not sure if there is anything you can do about it but I figured I would let you know in case you want to look into it. Some workarounds include manually setting the summary or setting the description to use another token other than
[node:summary]which is the default.Comment #9
scott_euser commentedThanks @cmconklin, that makes sense - so essentially if the citations are displayed twice in the main content of the page, the references & backlinks are then also displayed twice and the grouping of duplicates is not kicking in. The displaying twice happens when the text format has a summary and the citations appear in the summary. And just to confirm, we are still talking about the 3x branch correct? I am not contributing to the 3x branch myself, but hopefully someone can help step in to help here.
Comment #10
scott_euser commentedUpdated issue summary
Comment #11
chaseconklinSorry for the confusion, this is on the 4.x branch. The original issue was created on 3.x but this issue that I am experiencing is on the 4.x branch. I wasn't sure if a new issue should be created or if the version on this issue should be updated.
Comment #12
scott_euser commentedComment #13
scott_euser commentedActually, I'm going to create a new issue, just in case @emanaton's is a separate issue
Comment #14
scott_euser commentedMoved to #3440429: Duplicate footnotes when using footnote summary in metatag