Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gc-google-sheets/gcgs-disable-async.php
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

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 1 tabs, found 2 spaces

Check failure on line 13 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Multi-line function call not indented correctly; expected 4 spaces but found 2

Check warning on line 13 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Found precision alignment of 2 spaces.
return false;

Check failure on line 14 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 2 tabs, found 1

Check failure on line 14 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Tabs must be used to indent lines; spaces are not allowed
}

Check failure on line 15 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 1 tabs, found 2 spaces

Check failure on line 15 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Multi-line function call not indented correctly; expected 4 spaces but found 2

Check warning on line 15 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Found precision alignment of 2 spaces.

return $is_async;

Check failure on line 17 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 1 tabs, found 2 spaces

Check failure on line 17 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Multi-line function call not indented correctly; expected 4 spaces but found 2

Check warning on line 17 in gc-google-sheets/gcgs-disable-async.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Found precision alignment of 2 spaces.
}, 50, 4 );
Comment on lines +12 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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
In gc-google-sheets/gcgs-disable-async.php around lines 12 to 18, the anonymous
function body uses spaces for indentation which breaks PHPCS; replace the
leading spaces with tabs for each indented line inside the add_filter call
(function body, the if block, return statements, and the closing brace) so
indentation uses tabs consistently and matches the surrounding file style, then
run PHPCS to verify the fix.

Loading