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.

Invalid argument supplied for foreach() errors on site transfer

  1. I recently transferred my site from a local test server using backupbuddy.

    The new install seems to be working good except for my contact us form.

    The page is throwing these errors:

    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravity-forms-custom-post-types\gfcptaddonbase.php on line 116
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravity-forms-custom-post-types\gfcptaddonbase.php on line 50
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 1577
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 1577
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravity-forms-custom-post-types\gfcptaddonbase.php on line 116
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 1577
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 747
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 132
    
    Warning: Invalid argument supplied for foreach() in C:\Sites\wordpress\wp-content\plugins\gravityforms\form_display.php on line 1577

    This page is using the shortcode to display the form. I go to the forms section on the backend and edit the form i reference in the shortcode and it shows:
    `Form Settings : Form ID 13
    Untitled Form
    We would love to hear from you! Please fill out this form and we will get in touch with you shortly.'

    I checked the MySQL database and the form in question does appear in the database for wp_rg_form_meta but when with all the same content I checked against my local instal.

    Should I just try to create a new form. Any ideas as to what is going on? Current version of WP and GF are being used.

    Posted 11 years ago on Wednesday May 23, 2012 | Permalink
  2. David Peralty

    I am not sure at all. Can you try disabling the Custom Post Types add-on? And can you also try duplicating the form to see if it has the same issue? And does this issue only show on the page or in preview as well?

    Posted 11 years ago on Thursday May 24, 2012 | Permalink
  3. 1) Disabling the CPT add-on removes all errors on the page, but I then get "Oops! We could not locate your form."

    2) I exported the form from the local dev site and imported into the new site. The new form was created fine in the backend when imported. Updated page with the shortcode to the newly imported form. Form appears fine.

    3) Reactivated CPT add-on and error messages do not appear.

    Conclusion: Possible corrupt form on export/import with backupbuddy? The other 12 forms I had came over fine. Comparing the MySQL table with the local dev form and the new form created from the import there are some differences.

    Posted 11 years ago on Thursday May 24, 2012 | Permalink