Issue fork footnotes-3423588

Command icon 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

NickDickinsonWilde created an issue. See original summary.

scott_euser’s picture

Thanks for looking into this! Can you check if without the patch that any of your blocks are lazy loaded? If so you may need the 'Support for ajax loaded citations' bit mentioned on the homepage.

Another possibility is that you don't have this bit from the homepage in place "Set the block configuration for 'Current entity context for caching' to 'Node from URL'". If you could check/confirm those two options please

nickdickinsonwilde’s picture

Almost certainly lazy loaded - do have bigpipe enabled. On the homepage I just see

Separate footnote references block (optional) to output the citations via JavaScript instead of PHP in the case that footnotes may be loaded via ajax (eg, BigPipe, Views Ajax, etc)

Beyond placing it is there anything needed?

Adding it to my node via preprocess

  $footnotes = \Drupal::service('plugin.manager.block')->createInstance('footnotes_group', []);
  $variables['content']['custom_block_output'] = $footnotes->build();

Will investigate the caching options.

scott_euser’s picture

Ah sorry I can see that needs better documentation in case your are programmatically creating the block. If you add the block via the UI it's lazy loaded as well and has an option ''Group footnotes using JavaScript" which gets triggered to also watch for new footnotes appearing on ajax load completions.

nickdickinsonwilde’s picture

StatusFileSize
new6.4 KB

Just did it via the block UI instead and that is still getting wrong automatic numbers - it is getting all the numbers correctly and collecting them - it is just each text block/ckeditor area resets to 1.
ex:
multiple [1] footnotes

The links do point to the correct spots, just the numbers reset each text field.

nickdickinsonwilde’s picture

Note, this is being used with Layout Paragraphs (but all paragraphs on the same node/field), so chance that is impacting it versus straight paragraphs but I don't think so.

scott_euser’s picture

Okay thanks for the info, curious to figure this one out and get test coverage for it. I'll see if I can reproduce as well. I do like Layout Paragraphs as well, solid UI, have not played with it for a while so a good opportunity :)

scott_euser’s picture

Yes I can see this happening in Layout Paragraphs. MR on the way

scott_euser’s picture

Status: Active » Needs review

So the Footnotes All Block JS was having two issues:

  1. It was expecting the 'Disable output of the footnotes footer' to be unchecked and 'move' the multiple footnotes to the single group -> now it does that separately
  2. It was removing the group if nothing was found, but then in subsequent ajax loads if new footnotes would exist, the group would be gone -> now it hides instead of removes (and unhides if found)
scott_euser’s picture

Okay, I think your branch does not hurt either to try to get it right without the JS. With lazy builder stuff in some setups will need the fixed JS. Unless I hear otherwise from you, I will merge both branches next week. Thanks!

scott_euser’s picture

Okay, going to give up on cspell for now until #3423402: Document how to use the CSPELL job provides some clarity. Anyways they are warnings not failures.

  • scott_euser committed 09882ad5 on 4.0.x
    Issue #3423588: Automatic numbering with multiple text areas not working
    
scott_euser’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dhavalpanchal’s picture

Issue summary: View changes
StatusFileSize
new47.54 KB

@scott_euser I am using Paragraphs and facing the same issue. I’m currently using version 4.0.0-beta5 of the Footnotes module. The content type uses Paragraphs, and the problem occurs when I add new paragraph of the same type within the same node — the footnote numbering restarts from one instead of continuing sequentially.