Footnotes repeating

Created on 15 March 2024, 9 months ago
Updated 12 April 2024, 8 months ago

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:

  1. Install footnotes and paragraphs.
  2. Create a paragraph with a WYSIWYG text field with summary.
  3. 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.
  4. 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

Footnotes seem to be allowed to duplicate when they appear in the text summary (text format with summary type field).

πŸ› Bug report
Status

Needs work

Version

3.1

Component

Footnotes

Created by

πŸ‡ΊπŸ‡ΈUnited States emanaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @emanaton
  • πŸ‡ΊπŸ‡ΈUnited States emanaton
  • πŸ‡ΊπŸ‡ΈUnited States chaseconklin

    I 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.

  • Status changed to Needs work 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks 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:

    1. Which other filters are enabled in the text format and their order
    2. Which settings within the filter plugin are enabled within the text format
    3. Which block configuration is being used (if any)

    To make it easier to reproduce.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States chaseconklin

    In 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

    Filter processing order
    Linkit URL converter
    Limit allowed HTML tags and correct faulty HTML
    Footnotes filter
    Responsive wrappers filter
    Align images
    Caption images
    Restrict images to this site
    Track images uploaded via a Text Editor
    Lazy load images
    No Non-breaking Space Filter
    Replaces global and entity tokens with their values
    Display embedded entities
    Embed media
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Hmmm 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.

  • Status changed to Postponed: needs info 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡ΊπŸ‡ΈUnited States chaseconklin

    I think I just found a way to replicate the bug. Here are the steps:

    1. Install Drupal 10.1 latest
    2. Install metatag module
    3. Enable footnotes in CKE 5 (Set to collapse duplicates and set block rendering
    4. Create the metatag field for the basic page content type
    5. Create a new page with some content in the body field and leave the summary empty (Have the summary be generated for you)
    6. Add some footnotes to the body field and save the page
    7. The duplicates should appear

    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.

  • Status changed to Needs work 8 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks @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.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Updated issue summary

  • πŸ‡ΊπŸ‡ΈUnited States chaseconklin

    Sorry 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.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Actually, I'm going to create a new issue, just in case @emanaton's is a separate issue

Production build 0.71.5 2024