-
Notifications
You must be signed in to change notification settings - Fork 92
gcgs-disable-async.php: Added new snippet to disable async.
#1191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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' ) { | ||
|
Check failure on line 13 in gc-google-sheets/gcgs-disable-async.php
|
||
| return false; | ||
|
Check failure on line 14 in gc-google-sheets/gcgs-disable-async.php
|
||
| } | ||
|
Check failure on line 15 in gc-google-sheets/gcgs-disable-async.php
|
||
|
|
||
| return $is_async; | ||
|
Check failure on line 17 in gc-google-sheets/gcgs-disable-async.php
|
||
| }, 50, 4 ); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix indentation to use tabs instead of spaces.
The PHPCS pipeline is failing because the function body uses spaces for indentation instead of tabs, which violates the project's coding standards.
Apply this diff to fix the indentation:
add_filter( 'gform_is_feed_asynchronous', function( $is_async, $feed, $entry, $form ) { - if ( $feed['addon_slug'] === 'gp-google-sheets' ) { - return false; - } + if ( $feed['addon_slug'] === 'gp-google-sheets' ) { + return false; + } - return $is_async; + return $is_async; }, 50, 4 );🧰 Tools
🪛 GitHub Actions: PHP Lint (PR)
[warning] 13-13: PHPCS: Found precision alignment of 2 spaces.
[error] 13-13: PHPCS: Multi-line function call not indented correctly; expected 4 spaces but found 2.
🪛 GitHub Check: PHPCS (Files Changed)
[failure] 17-17:
Line indented incorrectly; expected at least 1 tabs, found 2 spaces
[failure] 17-17:
Multi-line function call not indented correctly; expected 4 spaces but found 2
[warning] 17-17:
Found precision alignment of 2 spaces.
[failure] 15-15:
Line indented incorrectly; expected 1 tabs, found 2 spaces
[failure] 15-15:
Multi-line function call not indented correctly; expected 4 spaces but found 2
[warning] 15-15:
Found precision alignment of 2 spaces.
[failure] 14-14:
Line indented incorrectly; expected at least 2 tabs, found 1
[failure] 14-14:
Tabs must be used to indent lines; spaces are not allowed
[failure] 13-13:
Line indented incorrectly; expected 1 tabs, found 2 spaces
[failure] 13-13:
Multi-line function call not indented correctly; expected 4 spaces but found 2
[warning] 13-13:
Found precision alignment of 2 spaces.
🤖 Prompt for AI Agents