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.

Potential BUG: Pre-Render Causing Forms To Break

  1. etrakdev
    Member

    I have several forms that all work without any problems. However, as soon as I add the pre render filter, the forms break with the "We could not locate your form". There doesn't even have to be any further code in the method, just the simple statement below will cause the forms to break:

    add_filter("gform_pre_render", "pre_render_function");
    function pre_render_function($form) {
    };

    This is in the functions.php file, so it should be in the right place.

    Anyone had issues with this? Am I overlooking something obvious?

    Thanks,

    JB

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  2. David Peralty

    You are putting this in a functions.php file in your activated theme folder, correct?

    Also, between the brackets, can you put return $form; and see what happens?

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  3. etrakdev
    Member

    Ah, that's the problem. I only looked at the top part of the filter documentation and not the examples, where it shows the return statement.

    So, adding the "return $form;" is obviously needed, which now works properly.

    Might be helpful to add into the documentation that the function call needs to return the form. Again, that may be obvious, but easy to overlook if it's not stated. :-)

    Thanks for jumping on it so quickly!

    Posted 12 years ago on Friday April 27, 2012 | Permalink