gravity-pdf
gravity-pdf copied to clipboard
Resolve cssClass grid repetition using repeater fields
Description
Solves PDF generation problem when using the Nested Forms add-on with Gravity Forms Columns when using a lot of repeater data.
This problems stems from the fact that $form['fields']
contains an array of field objects and our container changes the cssClass value by including our grid classes, when appropriate. This is normally fine, however, when inside a nested forms field those same form fields are processed multiple times and this would inject the grid CSS classes over and over again. This could cause display problems in the PDFs.
Testing instructions
- Create a Parent and Child form and include the Nested Forms field in the Parent
- The Child form needs to have fields positioned in columns using Drag and Drop
- Configure Zadani on the parent form
- Submit a test entry and include 3 nested form entries
- View the PDF HTML mark-up using
?html=1
and ensure you don't see the samegrid grid-#
classes duplicated/repeating multiple times in the fields i.e you don't want to see:grid grid-6 grid grid-6
orgrid grid-6 grid grid-6 grid grid-6
.
Checklist:
- [x] I've tested the code.
- [x] My code is easy to read, follow, and understand
- [ ] My code follows the accessibility standards.
- [x] My code has proper inline documentation / docblocks.
Additional Comments
Codecov Report
Merging #1408 (0e139bc) into development (493b8d5) will increase coverage by
0.02%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## development #1408 +/- ##
=================================================
+ Coverage 77.34% 77.37% +0.02%
- Complexity 2900 2901 +1
=================================================
Files 243 243
Lines 10107 10107
Branches 370 370
=================================================
+ Hits 7817 7820 +3
+ Misses 2282 2279 -3
Partials 8 8
Impacted Files | Coverage Δ | |
---|---|---|
src/Helper/Helper_Field_Container_Gf25.php | 90.00% <100.00%> (+6.00%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Notify HS with tags nested-forms-blank