From 551020e1bb443570e38071a3a73f63cd53fba0f7 Mon Sep 17 00:00:00 2001 From: Jake Jackson Date: Fri, 23 Feb 2024 12:07:47 +1100 Subject: [PATCH] Fix error savings forms in Gravity Forms 2.6.* --- README.txt | 3 +++ src/Controller/Controller_Form_Settings.php | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index 83f313ae8..74c85b325 100644 --- a/README.txt +++ b/README.txt @@ -107,6 +107,9 @@ Gravity PDF can be run on most modern shared web hosting without any issues. It == Changelog == += 6.8.1 = +* Bug: Fix Form Editor saving problem for Gravity Forms v2.6.* + = 6.8.0 = * Feature: Add PDF Download metabox to Gravity Flow Inbox for logged-in users with appropriate capability * Feature: Add AI-generated translations for French, Spanish, Italian, German, Dutch, Russian, and Chinese diff --git a/src/Controller/Controller_Form_Settings.php b/src/Controller/Controller_Form_Settings.php index 2a7a9e69b..3863dc5b7 100644 --- a/src/Controller/Controller_Form_Settings.php +++ b/src/Controller/Controller_Form_Settings.php @@ -263,11 +263,8 @@ public function clear_cached_pdf_settings( $form, $form_id, $meta_name ) { return $form; } - if ( method_exists( '\GFFormsModel', 'flush_current_form' ) ) { - \GFFormsModel::flush_current_form( \GFFormsModel::get_form_cache_key( $form_id ) ); - } else { - \GFFormsModel::flush_current_forms(); - } + /* In the unlikely event the PDFs have been updated since the execution cycle begun, clear the form cache */ + \GFFormsModel::flush_current_forms(); $updated_form = $this->gform->get_form( $form_id ); $form['gfpdf_form_settings'] = $updated_form['gfpdf_form_settings'] ?? [];