After updating webform 7.x-3.19 to 7.x-3.20, the css and javascripts applied on the existing webforms stopped working properly. The conditions made using the webform conditional module also do not work anymore.
I use fieldsets in webforms. I could see that the way in which the fieldset id is generated is different between these versions.
For eg;- in webform 7.x-3.19, it generates the id as follows
id="webform-component-formwrap-giftcard-step2--wrap-customer-step2--wrap-leveringsadres--wrap-leveradres"
in webform 7.x-3.20, it generates the id as follows
id="webform-component-formwrap-giftcard-step2-wrap-customer-step2-wrap-leveringsadres-wrap-leveradres"
Please note the absence of the extra hyphen (-) in the latest version, after step2 and leveringsadres (screenshots attached) . This only happens for fieldset, and the other elements in the webform are not impacted. The change in the id breaks the css, js and the conditional behaviour in the form.
I hope you could help me
Comment | File | Size | Author |
---|---|---|---|
#2 | webform_restore_fieldset_id-2243483.patch | 631 bytes | quicksketch |
Webform 7.x-3.19 fieldset id.JPG | 151.38 KB | taatg37 | |
Webform 7.x-3.20 fieldset id.JPG | 147.19 KB | taatg37 |
Comments
Comment #1
quicksketchIt looks like this was caused by #1613458: Form #states do not affect fieldsets from within $form["submitted"], which last changed the class names. I'll see if there's a way we can reconcile the class name differences and keep that working at the same time (we may not be able to).
Comment #2
quicksketchThis was caused by the addition of drupal_html_id() in that other issue. We had thought that it wasn't necessary in the first place but added it as a "best practice". Turns out it caused this problem because it will replace any two sequential hyphens with a single one. :(
To fix this, we can simply remove drupal_html_id(), which we avoid in other places for other reasons. The 7.x-4.x and 6.x-3.x versions are not affected by this problem, so I've committed this to 7.x-3.x only. Thanks for the report @taatg37!
Comment #4
taatg37 CreditAttribution: taatg37 commentedThanks for the patch, it solves the issue