Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce
- Create a webform
- Add a fieldset component
- Mark it is collapsible
- View the javascript errors when loading up the webform
Why is this bad?
It entirely kills javascript and no other javascript functions can run
Reasons the problem exists?
When any form element is marked as collapsible, drupal core injects the collapse.js to create the dropdown effect. However, the HTML produced for this collapsible via the webform component does not contain the "legend" attribute which collapse.js depends on.
Possible solutions
- Fix the webform component fieldset to make sure the legend is produced properly
- Fix Drupal 7's collapse.js to handle malformed collapsibles #1606110: Exception thrown in collapse.js by .after(' ') breaks CKEditor display in term edit pages
Comments
Comment #1
quicksketchWebform collapsed fieldsets use the same markup as core fieldsets. I can't reproduce a problem when using collapsed fieldsets. This is probably an issue caused by theming in your active theme. Can you reproduce this problem on a clean install of Webform with a stock theme?
Comment #2
DanChadwick CreditAttribution: DanChadwick commentedClosed for lack of activity and reproduction information.
Comment #3
lilbebel CreditAttribution: lilbebel commentedHello,
I've just started getting the problem on the website: http://tsmacademy.com/registration
You can see
STUDENT #2 INFORMATION
STUDENT #3 INFORMATION
STUDENT #4 INFORMATION
are no longer expandable. I can unselect the collapsed by default and collapsible buttons in the webform but that makes the form too long and confusing. I don't know why this has stopped working since I upgraded to the latest D7 Core. Any ideas?
Thanks,
Martha
Comment #4
lilbebel CreditAttribution: lilbebel commentedHello,
I fixed the problem by uninstalling JQueryUpdate module. I figured out the problem started after I aggregated and then unaggregated the JS in Performance. All is working now.
Martha