Repository navigation
Stop PDFs crashing on Gravity Forms before 2.8.2 when a field leaves a gap in its row (6.18.0) - #1966
Merged
Merged
Conversation
…a gap in its row (6.18.0) Backport of #1965, without the PHPStan baseline entry (6.18 has no PHPStan). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
2 tasks
This was referenced Oct 27, 2026
jakejackson1
pushed a commit
that referenced
this pull request
Oct 27, 2026
) * fix: end the row after a field that leaves a gap at the end of its row Helper_Field_Container_Gf25 looked the form up with $field->form_id, but Gravity Forms fields use formId, so the form was never found. A field that leaves a gap at the end of its row (a spacer) never ended the row, and the next field moved up into the gap. This also left the get_row_spacer() call #1966 guards unreachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: create the spacer test's form with the Gravity Forms test factory Integration tests can't call GFAPI::add_form() directly; CI's fixture check rejects it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Greg <gregory@gravitypdf.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jakejackson1
added a commit
that referenced
this pull request
Oct 27, 2026
#1975) Helper_Field_Container_Gf25 looked the form up with $field->form_id, but Gravity Forms fields use formId, so the form was never found. A field that leaves a gap at the end of its row (a spacer) never ended the row, and the next field moved up into the gap. This also left the get_row_spacer() call #1966 guards unreachable. Co-authored-by: Greg <gregory@gravitypdf.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #1965 to 6.18.0. PDFs of forms using the Gravity Forms 2.5+ column layout fatal on Gravity Forms 2.5–2.8.1 when a field leaves empty space at the end of its row. The field container calls
GFFormDisplay::get_row_spacer(), which Gravity Forms only added in 2.8.2, while Gravity PDF still allows 2.5+. On older versions the container now ends the row the way Gravity Forms did back then.GFFormDisplay::get_row_spacer()call withmethod_exists()Try it
By hand (needs Gravity Forms 2.6–2.8.1): on a form with legacy markup off, put two half-width fields in a row and a third half-width field on the next row by itself, submit an entry and view a Core PDF. Before this change the PDF fatals with "Call to undefined method GFFormDisplay::get_row_spacer()"; now it renders with the same rows as the form.
Test plan
More info
Found by an audit of
hot-patch-6.18.0for Gravity Forms symbols newer than the 2.5 floor; this was the only unguarded call that fatals.get_row_spacer()is@since 2.8.2in Gravity Forms 3.2 and is missing from the 2.6.1 and 2.6-beta1 copies checked.Gravity Forms 2.6.1 (
form_display.php:1119) outputs a spacer after every field whoselayoutSpacerGridColumnSpanis set when legacy markup is off.Helper_Field_Container_Gf25is only used when legacy markup is off (View_PDF.php:242,Field_Form.php:128), and the block already requires a non-emptylayoutSpacerGridColumnSpan, so the fallback just marks the end of the row. 2.8.2's version only adds the spacer to the last field in a layout group, which is why the newer path still asks Gravity Forms.Same source change as #1965, minus its PHPStan baseline entry (6.18 has no PHPStan). The CHANGELOG line is added at the end of the 🐞 Bug group under 6.18.0.
No new test: PHPUnit runs against Gravity Forms 3.x, where the method always exists, so the fallback can't be reached without stubbing a static method. Checks run locally: container PHPUnit tests (18 passing), PHPCS lint + PHP compatibility clean, run on the 6.18 build. Not checked on a real Gravity Forms 2.x install.
🤖 Generated with AI