Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8321bd7
chore: bump version to 6.14.3
jakejackson1 May 19, 2026
a0f3e32
fix: font manager footer icons on Tools tab and WP 7.0 sizing
jakejackson1 May 18, 2026
02e8497
fix: restore help-tab search result formatting
jakejackson1 May 18, 2026
16be67e
fix: centre Select Template button text and more-details hover label
jakejackson1 May 18, 2026
29092f6
fix: keep template modal open and show inline error on invalid zip up…
jakejackson1 May 18, 2026
31275ba
fix: replace glob with scandir in unzip_and_verify_templates
jakejackson1 May 18, 2026
590d7e9
refactor: use FilesystemIterator for unzipped template discovery
jakejackson1 May 18, 2026
8d2a409
refactor: drop find_template_files helper, extract getTabLocation, tr…
jakejackson1 May 19, 2026
6c443b3
fix: switch to \GFForms::$version to address backwards version_compar…
jakejackson1 May 19, 2026
154c29b
fix: TinyMCE editor destroy/reload process on template swap
jakejackson1 May 19, 2026
2e38778
refactor: remove unnecessary GFCache check in Helper_Abstract_Fields
jakejackson1 May 19, 2026
95b56d2
fix: preserve unsaved edits when switching PDF templates
jakejackson1 May 19, 2026
18db28a
docs: add 6.14.3 changelog entries for hot-patch fixes
jakejackson1 May 19, 2026
cc137c5
fix: treat non-2xx core-fonts responses as failures
jakejackson1 May 18, 2026
a364413
test: cover templateUploadProcessing success path and full form-field…
jakejackson1 May 18, 2026
4b091ed
fix: honour PDF Conditional Logic toggle so disabling it skips stale …
jakejackson1 May 19, 2026
5248010
fix: auto-restore the last-selected TinyMCE editor tab cleanly on tem…
jakejackson1 May 19, 2026
a134e7d
Finalize changelog for 6.14.3
jakejackson1 May 19, 2026
ca52064
Fix changelog formatting
jakejackson1 May 19, 2026
8f31ea5
Fix minor grammar error in changelog
jakejackson1 May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

## Gravity PDF

### 6.14.3
* 🧹 Housekeeping: WordPress 7.0 Compatibility
* 🧹 Housekeeping: Improved screen-reader support for admin pages
* 🧹 Housekeeping: Remove obsolete Gravity Forms cache workaround
* 🐞 Bug: Honor PDF Conditional Logic toggle setting, so disabling it in the UI skips stale conditional rules
* 🐞 Bug: Fix Rich Text Editor rendering error when switching PDF templates
* 🐞 Bug: Preserve unsaved edits to the Template fields if switching to a PDF template with the same fields (eg. Core / Invoice / Certificate)
* 🐞 Bug: Preserve the selected template when adding a new PDF
* 🐞 Bug: Fix Gravity Forms 2.6+ version detection on PDF form-settings pages
* 🐞 Bug: Fix regression in the Template Manager when an invalid .zip is uploaded
* 🐞 Bug: Minor UI fixes in the Template Manager
* 🐞 Bug: Fix regression in the Core Fonts installer when a download error occurs
* 🐞 Bug: Reset Gravity Wiz Nested Form field IDs after each group in PDFs

### 6.14.2
* 🐞Bug: Fix PHP warning caused by the GFCommon::get_lead_field_display() API change in Gravity Forms 2.9.29
* 🐞Bug: Fix merge tag rendering issue when switching between PDF templates
* 🐞Bug: Fix Font Manager to Font select field syncing issue
* 🐞Bug: Fix edge-case issue with the URL signing feature and improve verification/validation checks
* 🐞Bug: Rename Chinese language files so it is correctly used when the site language is set to the zh_CN locale.
* 🐞 Bug: Fix PHP warning caused by the GFCommon::get_lead_field_display() API change in Gravity Forms 2.9.29
* 🐞 Bug: Fix merge tag rendering issue when switching between PDF templates
* 🐞 Bug: Fix Font Manager to Font select field syncing issue
* 🐞 Bug: Fix edge-case issue with the URL signing feature and improve verification/validation checks
* 🐞 Bug: Rename Chinese language files so it is correctly used when the site language is set to the zh_CN locale.
* 🧹 Housekeeping: Improve template caching and performance
* 🧹 Housekeeping: Update PHP and Javascript dependencies
* 🧹 Housekeeping: Disable asset caching when `SCRIPT_DEBUG` constant enabled
Expand All @@ -17,24 +31,24 @@
### 6.14.1
* 🧹 Housekeeping: Add `gfpdf-{$type}` CSS class to the HTML mark-up when a field uses a different input type
* 🧹 Housekeeping: Use the field type (not input type) in the `gfpdf_pdf_field_content_{$type}` filter
* 🐞Bug: Fix PHP error if another plugin lazy loads the PSR/Log v1 library
* 🐞 Bug: Fix PHP error if another plugin lazy loads the PSR/Log v1 library

### 6.14.0
* 🎉 Feature: Rotate Gravity PDF log files when Gravity Forms logging is enabled. This prevents the log file getting to large.
* 🎉 Feature: Add support for using v1, v2, and v3 of the PSR/Log Composer library with Gravity PDF
* 🐞Bug: Fix PHP error if a third-party plugin loads PSR/Log v2 or v3
* 🐞 Bug: Fix PHP error if a third-party plugin loads PSR/Log v2 or v3

### 6.13.5
* 🐞Bug: Ensure background queue uses correct entry data when resending notifications
* 🐞Bug: Prevent plugins corrupting PDF data when viewing/downloading (via output buffer)
* 🐞 Bug: Ensure background queue uses correct entry data when resending notifications
* 🐞 Bug: Prevent plugins corrupting PDF data when viewing/downloading (via output buffer)

### 6.13.4
* 🐞Bug: Resolve PDF View/Download issue if both Event Espresso and LifterLMS plugin are installed
* 🐞 Bug: Resolve PDF View/Download issue if both Event Espresso and LifterLMS plugin are installed

### 6.13.3
* 🔒 Security: Remove the mPDF and Gravity PDF version numbers in the PDF metadata
* 🐞Bug: Resolve PHP error in 6.13.2 upgrade routine if the temporary PDF directory has been incorrectly set to a shared system folder
* 🐞Bug: Resolve PHP error if the `page` or `subview` admin URL parameters are arrays
* 🐞 Bug: Resolve PHP error in 6.13.2 upgrade routine if the temporary PDF directory has been incorrectly set to a shared system folder
* 🐞 Bug: Resolve PHP error if the `page` or `subview` admin URL parameters are arrays

### 6.13.2
* 🐞 Bug: Fix plugin build issue preventing the mPDF cache filesystem fix (6.13.0) from working
Expand Down
4 changes: 2 additions & 2 deletions pdf.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Gravity PDF
Version: 6.14.2
Version: 6.14.3
Description: Automatically generate highly customizable PDF documents using Gravity Forms and WordPress (canonical)
Author: Blue Liquid Designs
Author URI: https://blueliquiddesigns.com.au
Expand Down Expand Up @@ -36,7 +36,7 @@
/*
* Set base constants we'll use throughout the plugin
*/
define( 'PDF_EXTENDED_VERSION', '6.14.2' ); /* the current plugin version */
define( 'PDF_EXTENDED_VERSION', '6.14.3' ); /* the current plugin version */
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
Expand Down
16 changes: 0 additions & 16 deletions src/Helper/Helper_Abstract_Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Exception;
use GF_Field;
use GFCache;
use GFCommon;
use GFFormsModel;
use GFPDF\Statics\Kses;

Expand Down Expand Up @@ -232,20 +230,6 @@ final public function remove_cache() {
*/
final public function get_value() {

/**
* Gravity Forms' GFCache function was thrashing the database, causing double the amount of time for the field_value() method to run.
* The reason is that the cache was checking against a field value stored in a transient every time `GFFormsModel::get_lead_field_value()` is called.
* We're forcing the cache to skip the extra database lookup and just get the value.
*
* @hack
* @since 4.0
* @credit Zack Katz (Gravity View author)
* @fixed Gravity Forms 1.9.13.25
*/
if ( class_exists( 'GFCache' ) && version_compare( \GFForms::$version, '1.9.13.25', '<' ) ) {
GFCache::set( 'GFFormsModel::get_lead_field_value_' . $this->entry['id'] . '_' . $this->field->id, false, false, 0 );
}

/*
* Get the Gravity Forms field value
*
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/Helper_Abstract_Pdf_Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function get_pdf_config( $entry_id, $pdf_id ) {
throw new GravityPdfShortcodePdfInactiveException();
}

if ( isset( $settings['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $settings['conditionalLogic'], $entry ) ) {
if ( ! $this->misc->conditional_logic_passes( $settings, $entry ) ) {
throw new GravityPdfShortcodePdfConditionalLogicFailedException();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Helper/Helper_Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GFAPI;
use GFCommon;
use GFForms;
use GFFormsModel;
use WP_Error;

Expand Down Expand Up @@ -33,7 +34,7 @@ class Helper_Form extends Helper_Abstract_Form {
* @since 4.0
*/
public function get_version() {
return \GFForms::$version;
return GFForms::$version;
}

/**
Expand Down
33 changes: 33 additions & 0 deletions src/Helper/Helper_Misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,39 @@ public function update_deprecated_config( $value ) {
return $value;
}

/**
* Whether a PDF's saved settings should pass the entry through conditional-logic gating.
*
* The form-settings UI exposes two related fields: the `conditional` toggle (the user-visible
* on/off switch) and the `conditionalLogic` rules array. They can drift out of sync — the
* toggle gets disabled while the rules array keeps its previous value — so trusting only
* `conditionalLogic` makes the runtime disagree with what the UI shows.
*
* Returns true when the entry is allowed (toggle off, no rules, or rules pass), false when
* the toggle is on and rules explicitly reject the entry.
*
* The `conditional` key may be absent on very old settings; treat that as "no override,
* fall back to the rules" so legacy behaviour is preserved.
*
* @param array $settings The PDF settings array
* @param array $entry The Gravity Forms entry
*
* @return bool
*
* @since 6.14.3
*/
public function conditional_logic_passes( $settings, $entry ) {
if ( array_key_exists( 'conditional', $settings ) && empty( $settings['conditional'] ) ) {
return true;
}

if ( empty( $settings['conditionalLogic'] ) ) {
return true;
}

return $this->evaluate_conditional_logic( $settings['conditionalLogic'], $entry );
}

/**
* Determine if the logic should show or hide the item
*
Expand Down
5 changes: 3 additions & 2 deletions src/Helper/Helper_PDF_List_Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace GFPDF\Helper;

use GFForms;
use WP_List_Table;

/**
Expand Down Expand Up @@ -223,7 +224,7 @@ public function column_cb( $item ) {
$text = __( 'Inactive', 'gravity-pdf' );
}

$gf_less_than_288 = version_compare( \GFForms::$version, '2.8.8', '<' );
$gf_less_than_288 = version_compare( GFForms::$version, '2.8.8', '<' );

?>

Expand Down Expand Up @@ -290,7 +291,7 @@ public function column_shortcode( $item ) {

ob_start();
/* If the current GF version is 2.6 or higher, use the new updated UI for the shortcode button or else use the pre GF 2.5 version. */
if ( version_compare( '2.6-rc-1', \GFForms::$version, '<=' ) ):
if ( version_compare( GFForms::$version, '2.6.0', '>=' ) ):
?>
<button type="button"
class="gform-button gform-button--size-r gform-button--white gform-button--icon-leading gform-embed-form__shortcode-trigger btn-shortcode"
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Model_Form_Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace GFPDF\Model;

use GFForms;
use GFFormsModel;
use GFCommon;
use GFPDF\Helper\Helper_Abstract_Form;
use GFPDF\Helper\Helper_Abstract_Model;
use GFPDF\Helper\Helper_Abstract_Options;
Expand Down Expand Up @@ -225,7 +225,7 @@ public function show_edit_view( $form_id, $pdf_id ) {

/* add custom classes to form */
$form_classes = '';
if ( version_compare( '2.6-rc-1', \GFForms::$version, '<=' ) ) {
if ( version_compare( GFForms::$version, '2.6.0', '>=' ) ) {
$form_classes .= 'gfpdf-gf-2-6';
}

Expand Down
2 changes: 1 addition & 1 deletion src/Model/Model_Mergetags.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function process_pdf_mergetags( $text, $form, $entry, $url_encode ) {
/* Strip tag if config not valid, it isn't active or conditional logic is not met */
if ( is_wp_error( $config )
|| $config['active'] !== true
|| ( isset( $config['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $config['conditionalLogic'], $entry ) )
|| ! $this->misc->conditional_logic_passes( $config, $entry )
) {
$error = 'Conditional logic did not pass';
if ( is_wp_error( $config ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Model_PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public function middle_active( $action, $entry, $settings ) {
public function middle_conditional( $action, $entry, $settings ) {

if ( ! is_wp_error( $action ) ) {
if ( isset( $settings['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $settings['conditionalLogic'], $entry ) ) {
if ( ! $this->misc->conditional_logic_passes( $settings, $entry ) ) {
return new WP_Error( 'conditional_logic', esc_html__( 'PDF conditional logic requirements have not been met.', 'gravity-pdf' ) );
}
}
Expand Down Expand Up @@ -826,7 +826,7 @@ public function get_active_pdfs( $pdfs, $entry ) {
$form = apply_filters( 'gfpdf_current_form_object', $this->gform->get_form( $entry['form_id'] ), $entry, __FUNCTION__ );

foreach ( $pdfs as $pdf ) {
if ( $pdf['active'] && ( empty( $pdf['conditionalLogic'] ) || $this->misc->evaluate_conditional_logic( $pdf['conditionalLogic'], $entry ) ) ) {
if ( $pdf['active'] && $this->misc->conditional_logic_passes( $pdf, $entry ) ) {
$filtered[ $pdf['id'] ] = $pdf;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/Model/Model_Templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function ajax_process_uploaded_template() {

/* Get the template headers now all the files are in the right location */
$this->templates->flush_template_transient_cache();
$headers = $this->get_template_info( glob( $unzipped_dir_name . '*.php', GLOB_NOSORT ) );
$headers = $this->get_template_info( $this->templates->get_all_templates_in_folder( $unzipped_dir_name ) );

/* Fix template path */
$headers = array_map(
Expand Down Expand Up @@ -357,8 +357,10 @@ public function unzip_and_verify_templates( $zip_path ) {
throw new Exception( esc_html( $results->get_error_message() ) );
}

/* Check unzipped templates for a valid v4 header, or v3 string pattern */
$files = glob( $dir . '*.php', GLOB_NOSORT );
/* Check unzipped templates for a valid v4 header, or v3 string pattern.
Avoid glob() here — it can return a stale (empty) listing when called
immediately after unzip_file() writes via the WP_Filesystem abstraction */
$files = $this->templates->get_all_templates_in_folder( $dir );

if ( ! is_array( $files ) || count( $files ) === 0 ) {
throw new Exception( esc_html__( 'No valid PDF template found in Zip archive.', 'gravity-pdf' ) );
Expand Down
Loading
Loading