Email Form Widget - Warning: Invalid argument supplied for foreach()

Hi all,

I’m currently having issues with the Email Form widget, I’m using Mailchimp and I have the API key verified but for some reason every time I try to add the Widget on the Side Bar Menu, it shows the following error:

Warning: Invalid argument supplied for foreach() in /home/theinv20/public_html/wp-content/plugins/tco-email-forms/email-integration/functions/shortcodes/subscribe.php on line 153
Not an Email Forms valid form.

Can someone give my site a look please? Thank you

Hey there,

Is the warning preventing the Email Form from working? If not, please hide the warning message. It is also good to hide PHP messages in a live site. To do that, please follow this guide https://aristath.github.io/blog/wp-hide-php-errors.

If the issue persists, it could be due to Autoptimize, try deactivating it. You could also try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Thanks.

I tried deactivating WP Super Cache and Autoptimize without any results. I know that I had a conflict with Cornerston and those plugins before and I got cornerstone to work by disabling those plugins while designing the website and reenabling them afterwards.

Do you have any other insight? It looks like it is a Javascript error.

Thank you!

Hello There,

I have taken a closer look at your widgets and I found out that the Email Form widget wasn’t able to initialize. When using the widget, you will need to assign the form and actually hit the “Saved” button.

When you drag the widget, the form is set to null by default. Without hitting the save button, it will still be null which is why it is throwing the error. Once the form is set to an actual value which would resolve the issue.

If you need anything else we can help you with, don’t hesitate to open another thread.