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.

Validation Filter

  1. developdaly
    Member

    I'm trying to use the gform_validation filter, but running into several errors.

    add_filter( 'gform_validation_1', 'my_validation' );
    
    function my_validation($validation_result ) {
    }

    Just running that code without any actual validation (adding validation results in more warnings), prints the following error after submission and page refresh:

    Warning: Invalid argument supplied for foreach() in /my/server/path/wp-content/plugins/gravityforms/form_display.php on line 111

    AND where the form confirmation or form would be, Oops! We could not locate your form..

    I am absolutely certain there is a form with the ID of 1. I also am running gform_after_submission_1, but that shouldn't effect anything since that fires after validation and works just fine without the validation filter.

    Side note, Using the Gravity Forms "gform validation" Hook links to a 404 pastie.org example.

    Posted 12 years ago on Friday April 27, 2012 | Permalink
  2. kyle
    Member

    You might need to return $validation_result (the error might be coming later, when GF expects a value for $validation_result).

    I suspect you have already tried that, but figured I'd mention it, just in case.

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