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.
I noticed this because some custom JS wasn't running on one of our multi-page webforms. It happens with 7.x-4.5 but not 7.x-4.4. In the console, I see the message 'TypeError: target is undefined' happening in 'webform.js:174:8'.
target is fetched but not checked before attempting to use it. If I wrap lines 174-181 in 'if (target) { ... }' the error no longer appears.
Sorry for the lack of detailed repro steps, I just found and had to patch this on a live site where the security update was applied by our hosts.
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedIt's benign. Ignore it.
Or better, update to the latest dev, which has a completely re-written conditionals. Of course, test before you use it in production.
Comment #2
rootworkFor the record, this completely short-circuited an autocomplete field I was using -- that is, the field on which a condition was based was an autocomplete field. So I wouldn't describe it as "benign" since it caused a webform to stop working.
The error I got was:
TypeError: $triggerElement.attr(...) is undefined
I'm including that here for the purposes of anyone else searching for this issue.
That said, I was able to resolve the issue by removing the conditional and then re-adding it. Clearing the cache, including forced re-aggregation of JS files, hadn't fixed it. I'm hoping this fix isn't just temporary. If it is, I'll take a chance on upgrading to the dev version. Looking forward to the next release.