Skip to content

End the row after a field that leaves a gap at the end of its row (6.18.0) - #1975

Merged
jakejackson1 merged 1 commit into
hot-patch-6.18.0from
fix/container-row-gap-formid-6.18.0
Oct 27, 2026
Merged

jakejackson1 merged 1 commit into
hot-patch-6.18.0from
fix/container-row-gap-formid-6.18.0

Conversation

@zamoragregory

Copy link
Copy Markdown
Contributor

Summary

Since 6.12.4, Helper_Field_Container_Gf25 looked the form up with $field->form_id, but Gravity Forms fields store it as formId, so the lookup always failed. When a field left a gap at the end of its row (a spacer in the form editor), the row was never ended, and in the PDF the next field moved up into the gap. It also meant the get_row_spacer() call that #1966 guards was never reached.

The form is now looked up with $field->formId.

Try it

  1. In the form editor, make a field narrower than its row, leave the rest of the row empty, and put the next field on the row below.
  2. View an entry's PDF. The next field starts a new row, as on the form. Before this change it sat in the gap beside the first field.

Test plan

  • yarn test:php -- --filter test_spacer_ends_the_row
  • Try it steps above
More info
  • Found in the 6.18.0-RC3 review (C2).
  • The new test builds a two-field form whose first field leaves an 8-column gap, and checks the container writes both row separators. It fails without this change.
  • With the row now ending, the call Stop PDFs crashing on Gravity Forms before 2.8.2 when a field leaves a gap in its row (6.18.0) #1966 guards is reached, so its guard for Gravity Forms before 2.8.2 now applies.
  • Tested natively on WordPress 7.2-beta1 (Laragon, PHP 8.3):
    • The new test fails without the change and passes with it.
    • The existing test_close cases fail on 7.2 either way, because of the kses change the WordPress 7.2 PR fixes.
    • The full suite from a clean start, against RC3 on the same setup, has no new failures. The new test is added and passes.
  • Adds a CHANGELOG line.
  • The same fix for development is End the row after a field that leaves a gap at the end of its row #1973.

🤖 Generated with AI

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>
@jakejackson1
jakejackson1 merged commit b30acff into hot-patch-6.18.0 Oct 27, 2026
13 checks passed
@jakejackson1
jakejackson1 deleted the fix/container-row-gap-formid-6.18.0 branch October 27, 2026 01:45
@gravitypdf-bot gravitypdf-bot mentioned this pull request Oct 27, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants