gravity-pdf icon indicating copy to clipboard operation
gravity-pdf copied to clipboard

Resolve cssClass grid repetition using repeater fields

Open jakejackson1 opened this issue 2 years ago • 2 comments

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

  1. Create a Parent and Child form and include the Nested Forms field in the Parent
  2. The Child form needs to have fields positioned in columns using Drag and Drop
  3. Configure Zadani on the parent form
  4. Submit a test entry and include 3 nested form entries
  5. View the PDF HTML mark-up using ?html=1 and ensure you don't see the same grid grid-# classes duplicated/repeating multiple times in the fields i.e you don't want to see: grid grid-6 grid grid-6 or grid 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

jakejackson1 avatar Sep 01 '22 12:09 jakejackson1

Codecov Report

Merging #1408 (0e139bc) into development (493b8d5) will increase coverage by 0.02%. The diff coverage is 100.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.

codecov[bot] avatar Sep 01 '22 12:09 codecov[bot]

Notify HS with tags nested-forms-blank

jakejackson1 avatar Sep 01 '22 13:09 jakejackson1