Skip to content

Fix fatal error on Gravity Forms 3.0.2 upgrade - #49

Merged
forgetso merged 2 commits into
mainfrom
fix/gravity-forms-3.0.2-signature
Aug 10, 2026
Merged

Fix fatal error on Gravity Forms 3.0.2 upgrade#49
forgetso merged 2 commits into
mainfrom
fix/gravity-forms-3.0.2-signature

Conversation

@forgetso

Copy link
Copy Markdown
Member

Summary

  • Gravity Forms 3.0.2 added default values to GF_Field::get_field_label($force_frontend_label = true, $value = ''). Our override in Gravity_Field.php declared both params as required, so PHP's LSP signature check produces a fatal error on plugin load after the GF upgrade.
  • One-line fix: add matching defaults to the override.

Reported at: https://wordpress.org/support/topic/fatal-error-when-updating-gravity-forms/

Exact error:

Fatal error: Declaration of Io\Prosopo\Procaptcha\Integrations\Plugins\Gravity_Forms\Gravity_Field::get_field_label($force_frontend_label, $value) must be compatible with GF_Field::get_field_label($force_frontend_label = true, $value = '') in .../prosopo-procaptcha/src/Integrations/Plugins/Gravity_Forms/Gravity_Field.php on line 65

Test plan

  • Reproduced the exact fatal error locally with a standalone PHP script that stubs GF_Field at the 3.0.2 signature and loads Gravity_Field.php.
  • After the fix the class loads and instantiates cleanly against the same stub.
  • bash tools/check-code-quality.sh phpstan — passes (169/169).
  • bash tools/check-code-quality.sh codesniffer — passes.
  • bash tools/check-code-quality.sh pest — passes.
  • JS lint/prettier not run locally (no assets/node_modules); change is PHP-only so no JS impact.
  • Manual verification against a real Gravity Forms 3.0.2 install recommended before release.

🤖 Generated with Claude Code

forgetso and others added 2 commits August 10, 2026 11:55
GF 3.0.2 added default values to GF_Field::get_field_label(
$force_frontend_label = true, $value = ''). Our override declared
the parameters as required, so PHP's LSP signature check triggered
a fatal error on load.

Reported at:
https://wordpress.org/support/topic/fatal-error-when-updating-gravity-forms/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Latest Fluent Forms added a required $formId argument to
Submission::remove(); calling it without one now throws
InvalidArgumentException, which surfaced as a PHP fatal during form
submission in CI and broke the fluent-forms cypress spec.

The mu-plugin runs only in the test environment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@forgetso
forgetso merged commit 658f147 into main Aug 10, 2026
8 checks passed
This was referenced Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant