Disable Async on Google Sheets Feeds

By default, GC Google Sheets feeds run asynchronously. This snippet will disable that, so they run in the same request as the form submission.

This is useful for debugging whether there is a wider issue with asynchronous feeds on a site.

Installation:

  1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/

Instructions

See “Where do I put snippets?” in our documentation for installation instructions.

Code

Filename: gcgs-disable-async.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
 * Gravity Connect // Google Sheets // Disable Async on Google Sheets Feeds
 *
 * By default, GC Google Sheets feeds run asynchronously. This snippet will disable that, so they run in the same request as the form submission.
 *
 * This is useful for debugging whether there is a wider issue with asynchronous feeds on a site.
 *
 * Installation:
 *   1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
 */
add_filter( 'gform_is_feed_asynchronous', function( $is_async, $feed, $entry, $form ) {
	if ( $feed['addon_slug'] === 'gp-google-sheets' ) {
		return false;
	}

	return $is_async;
}, 50, 4 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.