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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

It 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).

quicksketch’s picture

Status: Active » Fixed
FileSize
631 bytes

This 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!

  • Commit 271398a on 7.x-3.x by quicksketch:
    Issue #2243483 by quicksketch | taatg37: Change in Fieldset id...
taatg37’s picture

Thanks for the patch, it solves the issue

Status: Fixed » Closed (fixed)

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