Visual Form Builder - Version 1.9.2

Version Description

Bug fix for copied form with nested fields.

Download this release

Release Info

Developer mmuro
Plugin Icon 128x128 Visual Form Builder
Version 1.9.2
Comparing to
See all releases

Code changes from version 1.9.1 to 1.9.2

Files changed (2) hide show
  1. readme.txt +9 -2
  2. visual-form-builder.php +10 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.1
6
  Tested up to: 3.3.1
7
- Stable tag: 1.9.1
8
 
9
  Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
10
 
@@ -25,7 +25,7 @@ Dynamically build forms using a simple interface. Forms include jQuery validatio
25
  * Customized Confirmation Messages
26
  * Redirect to a WordPress Page or a URL
27
  * Confirmation Email Receipt to User
28
- * Standard and Advanced Fields
29
  * Required Fields
30
  * Shortcode works on any Post or Page
31
  * Embed Multiple Forms on a Post/Page
@@ -173,6 +173,10 @@ To Export Selected:
173
 
174
  == Changelog ==
175
 
 
 
 
 
176
  **Version 1.9.1**
177
 
178
  * Bug fix for Sender Name, Email, and Notification Email overrides
@@ -265,6 +269,9 @@ To Export Selected:
265
 
266
  == Upgrade Notice ==
267
 
 
 
 
268
  = 1.9.1 =
269
  Recommend update! Bug fix for Sender Name, Email, and Notification Email overrides.
270
 
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.1
6
  Tested up to: 3.3.1
7
+ Stable tag: 1.9.2
8
 
9
  Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
10
 
25
  * Customized Confirmation Messages
26
  * Redirect to a WordPress Page or a URL
27
  * Confirmation Email Receipt to User
28
+ * Standard Fields
29
  * Required Fields
30
  * Shortcode works on any Post or Page
31
  * Embed Multiple Forms on a Post/Page
173
 
174
  == Changelog ==
175
 
176
+ **Version 1.9.2**
177
+
178
+ * Bug fix for copied forms with nested fields
179
+
180
  **Version 1.9.1**
181
 
182
  * Bug fix for Sender Name, Email, and Notification Email overrides
269
 
270
  == Upgrade Notice ==
271
 
272
+ = 1.9.2 =
273
+ Bug fix for copied form with nested fields.
274
+
275
  = 1.9.1 =
276
  Recommend update! Bug fix for Sender Name, Email, and Notification Email overrides.
277
 
visual-form-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Visual Form Builder
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
- Version: 1.9.1
7
  */
8
 
9
  /*
@@ -27,7 +27,7 @@ $visual_form_builder = new Visual_Form_Builder();
27
  /* Restrict Categories class */
28
  class Visual_Form_Builder{
29
 
30
- public $vfb_db_version = '1.9.1';
31
 
32
  public function __construct(){
33
  global $wpdb;
@@ -660,6 +660,10 @@ class Visual_Form_Builder{
660
  );
661
 
662
  $wpdb->insert( $this->field_table_name, $data );
 
 
 
 
663
 
664
  if ( $override == $field->field_id )
665
  $wpdb->update( $this->form_table_name, array( 'form_email_from_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
@@ -668,6 +672,10 @@ class Visual_Form_Builder{
668
  $wpdb->update( $this->form_table_name, array( 'form_notification_email' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
669
  }
670
 
 
 
 
 
671
 
672
  /* Set message to display */
673
  $this->message = '<div id="message" class="updated"><p>This form has been copied.</p></div>';
3
  Plugin Name: Visual Form Builder
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
+ Version: 1.9.2
7
  */
8
 
9
  /*
27
  /* Restrict Categories class */
28
  class Visual_Form_Builder{
29
 
30
+ public $vfb_db_version = '1.9.2';
31
 
32
  public function __construct(){
33
  global $wpdb;
660
  );
661
 
662
  $wpdb->insert( $this->field_table_name, $data );
663
+
664
+ /* If a parent field, save the old ID and the new ID to update new parent ID */
665
+ if ( in_array( $field->field_type, array( 'fieldset', 'section' ) ) )
666
+ $parents[ $field->field_id ] = $wpdb->insert_id;
667
 
668
  if ( $override == $field->field_id )
669
  $wpdb->update( $this->form_table_name, array( 'form_email_from_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
672
  $wpdb->update( $this->form_table_name, array( 'form_notification_email' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
673
  }
674
 
675
+ /* Loop through our parents and update them to their new IDs */
676
+ foreach ( $parents as $k => $v ) {
677
+ $wpdb->update( $this->field_table_name, array( 'field_parent' => $v ), array( 'form_id' => $new_form_selected, 'field_parent' => $k ) );
678
+ }
679
 
680
  /* Set message to display */
681
  $this->message = '<div id="message" class="updated"><p>This form has been copied.</p></div>';