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

DanChadwick’s picture

Priority: Normal » Minor
Status: Active » Closed (won't fix)

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

rootwork’s picture

For 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.