GravityPDF / gravity-pdf

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.
https://gravitypdf.com
88 stars 21 forks source link

Resolve cssClass grid repetition using repeater fields #1408

Closed jakejackson1 closed 1 year ago

jakejackson1 commented 1 year ago

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:

Additional Comments

codecov[bot] commented 1 year ago

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.

jakejackson1 commented 1 year ago

Notify HS with tags nested-forms-blank