PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Error: Invalid argument supplied for foreach()

  1. RealDesign
    Member

    I just installed Gravity Forms 1.4.4 on WordPress 3.0.1

    When I try to create a form, I add a field (let's say Name) and then hit save and it looks like it saves, but it resets to just the initial blank form text block (the Title stays changed though)

    When I try to preview the form I get:

    -----
    Warning: Invalid argument supplied for foreach() in /home/dsieb1/public_html/wp-content/plugins/gravityforms/form_display.php on line 746

    Warning: Invalid argument supplied for foreach() in /home/dsieb1/public_html/wp-content/plugins/gravityforms/form_display.php on line 746

    Warning: Invalid argument supplied for foreach() in /home/dsieb1/public_html/wp-content/plugins/gravityforms/form_display.php on line 746

    Contact Us
    We would love to hear from you! Please fill out this form and we will get in touch with you shortly.
    ------

    If I try to insert it into a page using Chrome, the insert box gets hung up
    I can insert it in Firefox, but then when I view and "submit" the form I get a page full of foreach() errors with different line refererences.

    http://resultsbydesignmarketing.com/request-info/

    Any help would be appreciated

    Posted 13 years ago on Tuesday November 2, 2010 | Permalink
  2. It is something specific to your site, possibly a plugin conflict, theme conflict or data issue. No way to debug this without having access to your site. If you can send us a WordPress admin login via our Contact Us form and reference this forum post we can take a look at it.

    Posted 13 years ago on Tuesday November 2, 2010 | Permalink
  3. The problem is a plugin you are running, p2pConverter, is outputting Javascript on every single WordPress Admin page, even pages the plugin has nothing to do with such as the Gravity Forms admin pages. This Javascript disrupts the form builder code and causes forms not to save properly. This is why you receive error messages.

    So the problem is the p2pConverter plugin. I went ahead and deactivated that plugin. Whoever created it doesn't know what they are doing and needs to read up on best practices when it comes to WordPress plugin development

    Posted 13 years ago on Tuesday November 2, 2010 | Permalink
  4. Steven
    Member

    Hi Carl,

    Similar situation for me. Already tried it with deactivating the p2pConverter plugin and all other plugins but the result remains the same. Also tried it with using the default Twenty Ten theme instead of K2... still the same. Will dig into this later tonight and if I need assistance I will sent more details over to you with a reference to this post.

    I get the following errors:

    Warning: Invalid argument supplied for foreach() in /home/.../wp-content/plugins/gravityforms/form_display.php on line 746

    Warning: Invalid argument supplied for foreach() in /home/.../wp-content/plugins/gravityforms/form_display.php on line 227

    Fatal error: [] operator not supported for strings in /home/.../wp-content/plugins/gravityforms/form_display.php on line 17

    Posted 13 years ago on Wednesday November 3, 2010 | Permalink
  5. Even after deactivating the p2pConverter plugin you will get that error on forms created while the p2pConverter plugin was active because it permanently damages those forms. If you were using the p2pConverter plugin you need to test by deactivating the p2pConverter plugin and then creating a new form and using the new form.

    Posted 13 years ago on Wednesday November 3, 2010 | Permalink
  6. Steven
    Member

    Ah... that explains. Thanks for the support - luckily I had a backup of the form so not too much harm for me :)

    Posted 13 years ago on Friday November 5, 2010 | Permalink
  7. Carl,

    I am having the same problem but I do not see that I have the p2pConverter plugin. Any other ideas. I did recently delete a form would this have anything to do with it?

    Thanks,

    Shayne

    Posted 13 years ago on Wednesday November 10, 2010 | Permalink
  8. Shayne,
    Could you send me a temporary WP admin login to alex@rocketgenius.com so that I could take a closer look and get this resolved for you?

    Posted 13 years ago on Wednesday November 10, 2010 | Permalink
  9. Interesting. I just encountered the same issue and do not have the p2pConverter plugin. I do have a header script on the page that's making 4 tabs for my forms. The forms were all fine with the script until this morning when I edited one of the forms.

    Now get this error: Warning: Invalid argument supplied for foreach() in /home/hoffman/public_html/dev/wp-content/plugins/gravityforms/form_display.php on line 746

    on this page: http://dev.hoffmangraphics.com/join-soco

    Fortunately I too have a back up so I can remove the form and recreate easily but don't want this happening regularly. I'm on 1.4.4 on this install.

    Here's what's in that header:
    <script type="text/javascript" src="p7epm/p7EPMscripts.js"></script>
    <link href="p7epm/epm4/p7EPM04.css" rel="stylesheet" type="text/css" media="all" />

    So is this script the issue and do I just need to make all my edits THEN add it? I'd like to avoid this issue down the line. Thanks.

    Posted 13 years ago on Thursday November 11, 2010 | Permalink
  10. Sheila,
    I am working on an issue that I believe is related to the error you are experiencing.
    Could you send me a WP admin login to alex@rocketgenius.com so that I can take a closer look?

    Posted 13 years ago on Thursday November 11, 2010 | Permalink
  11. On it's way to you now.

    Posted 13 years ago on Thursday November 11, 2010 | Permalink
  12. Anybody on versions 1.4 and above with issues saving the form please email me at alex@rocketgenius.com and I will send you an updated version with the fix

    Posted 13 years ago on Thursday November 11, 2010 | Permalink