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.

Warning Message On vieing Entries

  1. Hi Guys:

    Im currently seeing the following warning messages when I enter on of the form submission entries:

    Warning: nl2br() expects parameter 1 to be string, array given in /home/botanica/public_html/officechristmastrees.co.uk/wp-content/plugins/gravityforms/common.php on line 3770

    Do you think you know what this is and how i could get rid of it?

    Posted 13 years ago on Wednesday November 9, 2011 | Permalink
  2. Thank you for reporting this. However, it's a warning, not an error. Do you have WP_DEBUG turned on? You should not normally be outputting PHP warnings to the screen in a production environment.

    Posted 13 years ago on Wednesday November 9, 2011 | Permalink
  3. Just because it's a warning, does not mean it does not need to be resolved. This causes many issues when trying to develop 3rd party add-ons. The issue, at least for me, is that when using a Hidden Product field, the value is an array. In GFCommon:get_lead_field_display there is no case statement for the hiddenproduct field, and it uses the default case, which is to send the value to nl2br. Hidden's product is an array, not a string, so this is a BUG in gravity forms, not an warning that should be ignored.

    Please just have the devs add a check before calling nl2br to determine if the value they are sending to the function is a valid value.

    Posted 12 years ago on Saturday February 11, 2012 | Permalink