Commit 0add06ef authored by Kyle B. Johnson's avatar Kyle B. Johnson Committed by GitHub

Version bump v3.0.15

* Adding a parameter to the add:field and render:newField radio messages so that the higher-level "action" can be accessed by callbacks.

* correct data structure.

* version bump v3.0.15
parent 461cdc19
......@@ -4,7 +4,7 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.4
Tested up to: 4.6
Stable tag: 3.0.14
Stable tag: 3.0.15
License: GPLv2 or later
With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site.
......
......@@ -98,7 +98,8 @@ define( [], function() {
var tmpID = nfRadio.channel( currentDomainID ).request( 'get:tmpID' );
newModel.set( 'id', tmpID );
// Add new model.
nfRadio.channel( currentDomainID ).request( 'add', newModel );
// Params are: model, silent, renderTrigger, action
nfRadio.channel( currentDomainID ).request( 'add', newModel, false, false, 'duplicate' );
// Add our action addition to our change log.
var label = {
......
......@@ -63,10 +63,12 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function(
* Add a field to our collection. If silent is passed as true, no events will trigger.
*
* @since 3.0
* @param Object data field data to insert
* @param bool silent prevent events from firing as a result of adding
* @param Object data field data to insert
* @param bool silent prevent events from firing as a result of adding
* @param bool renderTrigger should this cause the view to re-render?
* @param string action action context - are we performing a higher level action? i.e. duplicate
*/
addField: function( data, silent, renderTrigger ) {
addField: function( data, silent, renderTrigger, action ) {
/*
* Set our fields 'adding' value to true. This enables our add field animation.
......@@ -74,6 +76,7 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function(
nfRadio.channel( 'fields' ).request( 'set:adding', true );
silent = silent || false;
action = action || '';
renderTrigger = ( 'undefined' == typeof renderTrigger ) ? true : renderTrigger;
if ( false === data instanceof Backbone.Model ) {
......@@ -103,7 +106,7 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function(
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
nfRadio.channel( 'fields' ).trigger( 'add:field', model );
if ( renderTrigger ) {
nfRadio.channel( 'fields' ).trigger( 'render:newField', newModel );
nfRadio.channel( 'fields' ).trigger( 'render:newField', newModel, action );
}
nfRadio.channel( 'fields' ).trigger( 'after:addField', model );
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.14' );
define( 'NF_PLUGIN_VERSION', '3.0.15' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -89,7 +89,7 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
$form_settings = $form->get_settings();
}
$this->_data[ 'form_id' ] = $this->_form_id;
$this->_data[ 'form_id' ] = $this->_form_data[ 'form_id' ] = $this->_form_id;
$this->_data[ 'settings' ] = $form_settings;
$this->_data[ 'settings' ][ 'is_preview' ];
$this->_data[ 'extra' ] = $this->_form_data[ 'extra' ];
......@@ -145,14 +145,21 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
// Duplicate the Field ID for access as a setting.
$field[ 'settings' ][ 'id' ] = $field[ 'id' ];
// Combine with submitted data.
$field = array_merge( $field, $this->_form_data[ 'fields' ][ $field_id ] );
// Flatten the field array.
$field = array_merge( $field, $field[ 'settings' ] );
/** Validate the Field */
$this->validate_field( $field[ 'settings' ] );
$this->validate_field( $field );
/** Process the Field */
$this->process_field( $field[ 'settings' ] );
$this->process_field( $field );
$field = array_merge( $field, $this->_form_data[ 'fields' ][ $field_id ] );
/** Populate Field Merge Tag */
$field_merge_tags->add_field( $field[ 'settings' ] );
$field_merge_tags->add_field( $field );
$this->_data[ 'fields' ][ $field_id ] = $field;
}
......
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 3.0.14
Version: 3.0.15
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -51,7 +51,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.0.14';
const VERSION = '3.0.15';
/**
* @var Ninja_Forms
......
......@@ -3,7 +3,7 @@ Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach,
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.4
Tested up to: 4.6.1
Stable tag: 3.0.14
Stable tag: 3.0.15
License: GPLv2 or later
Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more!
......@@ -102,7 +102,11 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.0.14 (03 November 2016) =
= 3.0.15 (09 November 2016) =
*Bugs:*
* Fixed a bug with custom field processing not updating field data properly.
*Bugs:*
......@@ -110,11 +114,20 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
*Changes:*
* Added per-form label settings under Advanced.
* Re-instated the changes and bug-fixes in version 3.0.12 (See below)
* Added better support for extensions interacting with field duplication in the builder.
== Changelog ==
= 3.0.15 (09 November 2016) =
*Bugs:*
* Fixed a bug with custom field processing not updating field data properly.
*Changes:*
* Added better support for extensions interacting with field duplication in the builder.
= 3.0.14 (03 November 2016) =
*Bugs:*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment