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.

BUG: Invalid argument supplied for foreach() forms_model.php

  1. In the function build_lead_array on line 2577 of forms_model.php, there is a check on line 2582 "if(is_array($results) && sizeof($results) > 0)", however the closing bracket is on line 2585, and on line 2588 there is a foreach loop on the $results variable, outside the check to see if it's an array. This throws an PHP WARNING. I'm not sure if this is the root of the problem, but by moving this loop inside the bracket (placing the bracket on line 2605), it causes the notice to go away. I'm not sure if this has been addressed or mentioned already, but wanted to bring it to the attention of the developers.

    Posted 12 years ago on Wednesday August 22, 2012 | Permalink
  2. I am getting this warning after upgrading and cannot see the entries of my form?

    Warning: Invalid argument supplied for foreach() in /home/inspired/public_html/dev/ukweddingawards/wp-content/plugins/gravityforms/forms_model.php on line 2612

    Can this be resolved?

    Posted 12 years ago on Thursday August 23, 2012 | Permalink
  3. @infomedia, thanks for the heads up. The changes you have suggested make sense.
    Huw, I have a new version with the change. Send me an email to alex@rocketgenius.com if you would like to try it and see if it fixes your issue. Make sure to include a link to this post.

    Posted 12 years ago on Thursday August 23, 2012 | Permalink

This topic has been resolved and has been closed to new replies.