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.

Trouble with the gform_after_submission hook and the $entry object

  1. I'm having some trouble with the gform_after_submission action. I have a multisite installation with a 5 page step form that uses the gform_after_submission action to gather data from the $entry object and store it as a post entry in a custom post type.

    The problem is that the $entry object return seems to be incomplete, with 95% of the field values displayed as empty.

    The following proof of concept function has been placed in a theme's functions.php file. The $entry fields output all appear to be empty after the second question:

    function gravity_after_submission( $entry, $form ) {
    	echo '<pre>';
    	print_r($entry);
    	echo '</pre>';
    	exit;
    }
    add_action( 'gform_after_submission', 'gravity_after_submission', 10, 2 );

    The array that is output:

    https://gist.github.com/3919004

    When I display the $_POST variable using that same action, I do see that all of the form data has in fact been submitted, but I would prefer to work with the $entry object over the raw $_POST.

    I've been searching around the forms_model.php and forms_display.php trying to pin down where the issue is occurring, but I have a feeling it may be a database/multisite storage issue.

    Any assistance from someone would be greatly appreciated, I've been staring at this for too long and I have a hunch it could be something simple.

    Thanks!

    Posted 9 years ago on Friday October 19, 2012 | Permalink
  2. I've solved the issue. Database caching with APC was enabled using W3 Total Cache plugin. wp_rg fields were avoided, but not multisite table prefixes. e.g. wp_3_rg_. Adding wp_3_rg_ to the W3 Total Cache Settings > Database Cache > Advanced > Ignored query stems section solved the issue.

    Posted 9 years ago on Monday October 22, 2012 | Permalink
  3. I am glad you figured it out. Thanks for the info.

    Posted 9 years ago on Tuesday October 23, 2012 | Permalink

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