Problem/Motivation
We get this JS error when using the footnotes_group block:
Uncaught TypeError: footnote.querySelector(...) is null
attach http://mnhn.drupal9-mnhn.docksal.site/modules/contrib/footnotes/assets/js/footnotes.group_block.js?v=10.3.5:67
attach http://mnhn.drupal9-mnhn.docksal.site/modules/contrib/footnotes/assets/js/footnotes.group_block.js?v=10.3.5:54
attachBehaviors http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.js?v=10.3.5:166
attachBehaviors http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.js?v=10.3.5:162
<anonymous> http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.init.js?v=10.3.5:32
listener http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.init.js?v=10.3.5:20
domReady http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.init.js?v=10.3.5:26
<anonymous> http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.init.js?v=10.3.5:31
<anonymous> http://mnhn.drupal9-mnhn.docksal.site/core/misc/drupal.init.js?v=10.3.5:34
footnotes.group_block.js:67:20
Steps to reproduce
Create a footnotes_group and enable the "Group footnotes using JavaScript" option.
Insert a footnote with an explicit footnote value (no auto numbering).
Proposed resolution
Drupal.behaviors.footnotesGroup.attach() should check if footnote.querySelector('.js-is-auto') returns something before trying to use it.
Comments
Comment #3
prudloff commentedComment #6
scott_euser commentedLooks good, thank you!