Conditional Fields for Contact Form 7 - Version 2.1.6

Version Description

(2022-06-07) = * Fix bug: text view cleared after making a change to form code when there are more than 50 conditions.

Download this release

Release Info

Developer Jules Colle
Plugin Icon 128x128 Conditional Fields for Contact Form 7
Version 2.1.6
Comparing to
See all releases

Code changes from version 2.1.5 to 2.1.6

contact-form-7-conditional-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://bdwm.be/
5
  * Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  * Author: Jules Colle
7
- * Version: 2.1.5
8
  * Author URI: http://bdwm.be/
9
  * Text Domain: cf7-conditional-fields
10
  * License: GPL v2 or later
4
  * Plugin URI: http://bdwm.be/
5
  * Description: Adds support for conditional fields to Contact Form 7. This plugin depends on Contact Form 7.
6
  * Author: Jules Colle
7
+ * Version: 2.1.6
8
  * Author URI: http://bdwm.be/
9
  * Text Domain: cf7-conditional-fields
10
  * License: GPL v2 or later
init.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '2.1.5' );
4
  if (!defined('WPCF7CF_CF7_MIN_VERSION')) define( 'WPCF7CF_CF7_MIN_VERSION', '5.4' );
5
  if (!defined('WPCF7CF_CF7_MAX_VERSION')) define( 'WPCF7CF_CF7_MAX_VERSION', '5.5.6.1' );
6
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
1
  <?php
2
 
3
+ if (!defined('WPCF7CF_VERSION')) define( 'WPCF7CF_VERSION', '2.1.6' );
4
  if (!defined('WPCF7CF_CF7_MIN_VERSION')) define( 'WPCF7CF_CF7_MIN_VERSION', '5.4' );
5
  if (!defined('WPCF7CF_CF7_MAX_VERSION')) define( 'WPCF7CF_CF7_MAX_VERSION', '5.5.6.1' );
6
  if (!defined('WPCF7CF_REQUIRED_WP_VERSION')) define( 'WPCF7CF_REQUIRED_WP_VERSION', '4.1' );
js/scripts_admin.js CHANGED
@@ -185,11 +185,15 @@ if (typeof(_wpcf7) != 'undefined' || typeof(wpcf7) != 'undefined') {
185
  updateDisplayOfEntries();
186
 
187
  }
 
 
 
 
 
 
188
 
189
  wpcf7cf.maybeDisableAddButton = function() {
190
- if (wpcf7cf.getnumberOfTextEntries() >= wpcf7cf.MAX_CONDITIONS && wpcf7cf.getnumberOfFieldEntries() == 0 ||
191
- wpcf7cf.getnumberOfFieldEntries() >= wpcf7cf.MAX_CONDITIONS
192
- ) {
193
  wpcf7cf.$addButton.hide();
194
  wpcf7cf.$maxReachedWarning.show();
195
  } else {
@@ -527,8 +531,10 @@ if (typeof(_wpcf7) != 'undefined' || typeof(wpcf7) != 'undefined') {
527
  if( !wpcf7cf_formcode || wpcf7cf_formcode !== this.value ) {
528
  wpcf7cf_formcode = this.value;
529
  updateAvailableGroupsAndFields();
530
- wpcf7cf.copyTextToFields();
531
- wpcf7cf.copyFieldsToText();
 
 
532
  }
533
  });
534
 
185
  updateDisplayOfEntries();
186
 
187
  }
188
+
189
+ wpcf7cf.isMaxConditionsReached = function() {
190
+ return wpcf7cf.getnumberOfTextEntries() >= wpcf7cf.MAX_CONDITIONS && wpcf7cf.getnumberOfFieldEntries() == 0 ||
191
+ wpcf7cf.getnumberOfFieldEntries() >= wpcf7cf.MAX_CONDITIONS;
192
+
193
+ }
194
 
195
  wpcf7cf.maybeDisableAddButton = function() {
196
+ if (wpcf7cf.isMaxConditionsReached()) {
 
 
197
  wpcf7cf.$addButton.hide();
198
  wpcf7cf.$maxReachedWarning.show();
199
  } else {
531
  if( !wpcf7cf_formcode || wpcf7cf_formcode !== this.value ) {
532
  wpcf7cf_formcode = this.value;
533
  updateAvailableGroupsAndFields();
534
+ if (!wpcf7cf.isMaxConditionsReached()) {
535
+ wpcf7cf.copyTextToFields();
536
+ wpcf7cf.copyFieldsToText();
537
+ }
538
  }
539
  });
540
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Website: http://bdwm.be
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 5.0
8
  Tested up to: 6.0
9
- Stable tag: 2.1.5
10
  Requires PHP: 7.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -123,6 +123,9 @@ Make sure to also update CF7 to the latest version! (Version 2.0 is only compati
123
 
124
  == Changelog ==
125
 
 
 
 
126
  = 2.1.5 (2022-05-22) =
127
  * Fully tested with Contact Form 7 version 5.5.6.1
128
 
6
  Tags: wordpress, contact form 7, forms, conditional fields
7
  Requires at least: 5.0
8
  Tested up to: 6.0
9
+ Stable tag: 2.1.6
10
  Requires PHP: 7.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
123
 
124
  == Changelog ==
125
 
126
+ = 2.1.6 (2022-06-07) =
127
+ * Fix bug: text view cleared after making a change to form code when there are more than 50 conditions.
128
+
129
  = 2.1.5 (2022-05-22) =
130
  * Fully tested with Contact Form 7 version 5.5.6.1
131