Skip to content

Commit

Permalink
Improve column support when there is a spacer
Browse files Browse the repository at this point in the history
Better calculate when Gravity Forms would insert a spacer into the form, so we can correctly end a row in the PDF.
  • Loading branch information
jakejackson1 committed Nov 10, 2024
1 parent fcfbef6 commit 719257c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Helper/Helper_Field_Container_Gf25.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ public function generate( GF_Field $field ) {
$field->cssClass = trim( 'grid grid-' . $field->layoutGridColumnSpan . ' ' . $field->cssClass );
}

/* Mark as the end of this row */
/* Mark as the end of this row if Gravity Forms would insert a spacer */
if ( ! empty( $field->layoutSpacerGridColumnSpan ) ) {
$this->end_of_row = true;
$gform = \GPDFAPI::get_form_class();
$form = $gform->get_form( $field->form_id );

Check warning on line 70 in src/Helper/Helper_Field_Container_Gf25.php

View check run for this annotation

Codecov / codecov/patch

src/Helper/Helper_Field_Container_Gf25.php#L69-L70

Added lines #L69 - L70 were not covered by tests

if ( ! empty( \GFFormDisplay::get_row_spacer( $field, $form ) ) ) {
$this->end_of_row = true;

Check warning on line 73 in src/Helper/Helper_Field_Container_Gf25.php

View check run for this annotation

Codecov / codecov/patch

src/Helper/Helper_Field_Container_Gf25.php#L72-L73

Added lines #L72 - L73 were not covered by tests
}
}
}

Expand Down

0 comments on commit 719257c

Please sign in to comment.