weDevsOfficial/wp-user-frontend

JS Errors with Post Form Conditional Logic

al3xstanhope opened this issue · 3 comments

With the latest version of WP User Frontend Pro, we have noticed that Post Forms created using older versions of the plugin with active "Conditional Logic" in place, now have JavaScripr errors, which means it is no longer possible to edit the conditions.

Sadly, this happens even with a default WordPress Theme installed, and no other plugins active, so it's very definitely an issue with WPUF from what I can see.

The error details from the console are shown below for your reference:

TypeError: undefined is not an object (evaluating 'wpuf_cond.field_type[i]')
(anonymous function) — wpuf-form-builder-components-pro.js:351
N — underscore.min.js:2:9376
created — wpuf-form-builder-components-pro.js:333
ve — vue.min.js:6:10457
(anonymous function) — vue.min.js:6:18902
a — vue.min.js:6:20278
Ie — vue.min.js:6:14342
init — vue.min.js:7:31664
s — vue.min.js:6:24641
a — vue.min.js:6:24267
f — vue.min.js:6:25184
a — vue.min.js:6:24383
(anonymous function) — vue.min.js:6:28786
(anonymous function) — vue.min.js:6:8488
r — vue.min.js:6:9300
(anonymous function) — vue.min.js:7:30283
Co — vue.min.js:7:30104
ue — vue.min.js:6:9334
init — vue.min.js:7:31683
s — vue.min.js:6:24641
a — vue.min.js:6:24267
f — vue.min.js:6:25184
a — vue.min.js:6:24383
f — vue.min.js:6:25184
a — vue.min.js:6:24383
_ — vue.min.js:6:26702
b — vue.min.js:6:27298
(anonymous function) — vue.min.js:6:28382
(anonymous function) — vue.min.js:6:8465
r — vue.min.js:6:9300
(anonymous function) — vue.min.js:7:30283
(anonymous function) — vue.min.js:7:30918
me — vue.min.js:6:10694
(anonymous function) — vue.min.js:7:26707
e — vue.min.js:7:26164

Hello @al3xstanhope,

Sorry to hear about your problem.

Please replace line no: 351 ofwpuf-pro/assets/js/wpuf-form-builder-components-pro.js with below code:

field_type: (wpuf_cond.field_type !== undefined) && (wpuf_cond.field_type[i] !== undefined) ? wpuf_cond.field_type[i] : ''

If you're still getting that problem, please contact our support so that we can check it in every possible way.

Hey @sapayth! Thanks SO much for the new code snippet! That's fixed the issue for us :)