Skip Navigation

[Resolved] Uncaught TypeError & infinite loops in CRED Post Forms after update to 2.0

This thread is resolved. Here is a description of the problem and solution.

The parameter mode="fade" in shortcode [cred_show_group] trigger the JS error

This is a bug of CRED version 1.6, the shortcode:
[cred_show_group ... mode="fade"] will trigger JS error:
Uncaught TypeError: n.easing[this.easing] is not a function

Solution:

edit it from:
[cred_show_group if="($(general-for-sale) gte '1' ) AND ($(general-for-sale) ne '9' ) AND ($(general-for-sale) ne '24' )" mode="fade"]

To:
[cred_show_group if="($(general-for-sale) gte '1' ) AND ($(general-for-sale) ne '9' ) AND ($(general-for-sale) ne '24' )" mode="slide"]

Relevant Documentation:
It will change the Jquery-ui effect from "fade" to "slide"

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#390207

Jay
General For Sale Post Form Error.png
Community Post Form Error.png

Hi,

I am currently developing a digital marketplace site with Toolset.

Some of my frontend CRED forms have conditional fields which have stopped functioning. I'm getting Uncaught TypeErrors when triggering a conditional field.

Furthermore, when triggering something like a date picker, I'm experiencing an infinite loop in Post Forms.

More info:

- I am using the latest version of all Toolset plugins

- I am using the latest version of WordPress

- I am using the latest version of the Toolset Starter Theme (however the problem exists in the default WordPress 2016 theme as well).

- I am NOT using the Layouts plugin

- I have tried disabling all non-Toolset plugins to no avail.

- I have tried reinstalling all Toolset plugins with no effect.

- I have reinstalled a fresh copy of WordPress with no effect.

Attached are two example screenshots of the CRED forms with the Chrome Console visible illustrating the problems I am experiencing.

Please advise as to my next step in fixing this. These errors have stopped my development in it's tracks.

Thank you!

#390421

Dear Jason,

I can not find the error message "Uncaught TypeError" in both of the screenshots you provided:
hidden link
hidden link

Could you duplicate same problem in a test site, and fill below private detail box with login details, also point out the problem page URL and CRED form URL, I need a live website to test and debug, thanks

#390461

Jay

Luo,

I'm confused. Both screenshots include multiple shots of my console after I initially show the cred form code.

If you view the screenshots in a new tab (viewing them at 100%), and scroll down the image to the error consoles that I've included , you should clearly see the errors being triggered... as well as my comments (in pink & red)( above each section illustrating exactly what's happening at each stage.

The errors shown in the screenshots clearly display: "Uncaught TypeError: n.easing[this.easing] is not a function". As well as an infinite loop when selecting a datepicker.

Please take another closer look at those! 🙂

I've privately included access to my site and ftp so you can see for yourself. Note that it's a multisite install. The first site is empty, the second you'll see Toolset entries.

Once logged in, if you go to pages, you'll see I have a "create" parent directory, with 6 different child pages inside it with a cred form in each.

Specifically, look at General For Sale and Community as they are finished and the simplest to see the problem in, however the errors affect all of them.

Once viewing one of those post forms from the frontend, If you have Chrome Dev Console open while you change the first field - "Select Category", you'll note that conditional logic is firing for some of the categories.

ie: The General For Sale post form shows the "Price" field conditionally on all categories except "Free Section" and "Swap and Trade".

As soon as the conditional logic is triggered, you should see the Uncaught TypeError in the console. Additionally, if you switch back to Free Section after triggering the conditional logic, the field remains.

On the Community Form, the same happens. And you'll see that selecting certain categories will conditionally show an event date picker field. This will trigger the error as well.

However, note that clicking on the date picker field itself (once it appears conditionally), will trigger an infinite loop.

Again, this is all clearly illustrated in my two screenshots if you would kindly revisit them, view them at 100% in a new tab, and scroll down (as they are very tall images).

Let me know if that clears things up!

Thanks Luo

#390497

Thanks for the details, I can duplicate same problem in my localhost.
I can see the error message in my Chrome browser:
jquery.js?ver=1.12.3:4 Uncaught TypeError: n.easing[this.easing] is not a function

I put it into our to-do list, our developers will take care of it.

Currently you can try this:
Edit the problem CRED form:
hidden link
find this line, edit it from:
[cred_show_group if="($(general-for-sale) gte '1' ) AND ($(general-for-sale) ne '9' ) AND ($(general-for-sale) ne '24' )" mode="fade"]

To:
[cred_show_group if="($(general-for-sale) gte '1' ) AND ($(general-for-sale) ne '9' ) AND ($(general-for-sale) ne '24' )" mode="slide"]

It will change the Jquery-ui effect from "fade" to slide

#390502

Jay

Thanks Luo.

One thing tho... the infinite loop when triggering the date picker on the Community form is a huge problem. Is there a workaround for that?

#390813

I assume we talking about the problem page:
hidden link
And the problem CRED form:
hidden link

I just checked the above problem page, it shows blank in content area, so I switch to wordpress default theme, and change the content template to "None":
hidden link

Then test it in front-end, but can not see the JS errors, it works fine. could you describe detail steps to duplicate same problem? how to trigger the problem:
the infinite loop when triggering the date picker on the Community form

#391007

Jay

Hi Luo,

It seems that changing the conditional transition in jQuery from fade to slide fixed the infinite loop on the date picker as well.

Do you think this bug will be fixed soon or is a ways off? I wasn't sure how serious it was.

Thanks for following up!

#391918

It will be fixed in the next version of CRED.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.