Commit 86df505b authored by Kevin Stover's avatar Kevin Stover

Merge branch 'develop'

parents 4a408c7b 0d6a638d
...@@ -4,7 +4,7 @@ ...@@ -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, 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.5 Requires at least: 4.5
Tested up to: 4.7.1 Tested up to: 4.7.1
Stable tag: 3.0.24 Stable tag: 3.0.25
License: GPLv2 or later 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. 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.
......
...@@ -69,7 +69,7 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function( ...@@ -69,7 +69,7 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function(
* @param string action action context - are we performing a higher level action? i.e. duplicate * @param string action action context - are we performing a higher level action? i.e. duplicate
*/ */
addField: function( data, silent, renderTrigger, action ) { addField: function( data, silent, renderTrigger, action ) {
/* /*
* Set our fields 'adding' value to true. This enables our add field animation. * Set our fields 'adding' value to true. This enables our add field animation.
*/ */
...@@ -88,6 +88,8 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function( ...@@ -88,6 +88,8 @@ define( ['models/fields/fieldCollection', 'models/fields/fieldModel'], function(
var model = data; var model = data;
} }
// console.log( model );
/* /*
* TODO: Add an nfRadio message filter for the model variable. * TODO: Add an nfRadio message filter for the model variable.
* Currently, we manually replace for saved fields; this should be moved to a separate controller. * Currently, we manually replace for saved fields; this should be moved to a separate controller.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* When we add a new field, update its key. * When we add a new field, update its key.
* *
* When we change the key, update any refs to the key. * When we change the key, update any refs to the key.
* *
* @package Ninja Forms builder * @package Ninja Forms builder
* @subpackage Fields * @subpackage Fields
* @copyright (c) 2015 WP Ninjas * @copyright (c) 2015 WP Ninjas
...@@ -26,7 +26,7 @@ define( [], function() { ...@@ -26,7 +26,7 @@ define( [], function() {
/** /**
* Add a key to our new field model. * Add a key to our new field model.
* *
* @since 3.0 * @since 3.0
* @param backbone.model model new field model * @param backbone.model model new field model
* @return void * @return void
...@@ -52,17 +52,17 @@ define( [], function() { ...@@ -52,17 +52,17 @@ define( [], function() {
* When we're editing settings, we expect the edits to fire one at a time. * When we're editing settings, we expect the edits to fire one at a time.
* Since we're calling this in the middle of our label update, anything that inquires about what has changed after we set our key will see both label and key. * Since we're calling this in the middle of our label update, anything that inquires about what has changed after we set our key will see both label and key.
* We need to remove the label from our model.changed property so that all that has changed is the key. * We need to remove the label from our model.changed property so that all that has changed is the key.
* *
*/ */
delete model.changed.label; delete model.changed.label;
var key = this.keyExists( model.get( 'label' ) ); var key = this.keyExists( model.get( 'label' ) );
model.set( 'key', key ); model.set( 'key', key );
} }
}, },
/** /**
* When a field key is updated, find any merge tags using the key and update them. * When a field key is updated, find any merge tags using the key and update them.
* *
* @since 3.0 * @since 3.0
* @param backbone.model model field model * @param backbone.model model field model
* @return void * @return void
...@@ -84,6 +84,14 @@ define( [], function() { ...@@ -84,6 +84,14 @@ define( [], function() {
var error = false; var error = false;
if ( '' == jQuery.trim( key ) ) { if ( '' == jQuery.trim( key ) ) {
error = 'Field keys can\'t be empty. Please enter a key.'; error = 'Field keys can\'t be empty. Please enter a key.';
} else if ( key != key.toLowerCase() ) {
error = 'Field keys must be lowercase.';
} else if ( key != key.replace( ' ', '_' ) ) {
error = 'Field keys must cannot use spaces. Separate with "_" instead.';
} else if ( '_' == key.slice( -1 ) ) {
error = 'Field keys cannot end with a "_"';
} else if ( key != this.slugify( key ) ) {
error = 'Invalid Format.';
} else if ( key != this.keyExists( key, dataModel ) ) { } else if ( key != this.keyExists( key, dataModel ) ) {
error = 'Field keys must be unique. Please enter another key.' error = 'Field keys must be unique. Please enter another key.'
} }
...@@ -97,7 +105,7 @@ define( [], function() { ...@@ -97,7 +105,7 @@ define( [], function() {
}, },
keyExists: function( key, dataModel ) { keyExists: function( key, dataModel ) {
var newKey = jQuery.slugify( key, { separator: '_' } ); var newKey = this.slugify( key );
if ( 0 != newKey.length ) { if ( 0 != newKey.length ) {
key = newKey; key = newKey;
} }
...@@ -110,12 +118,16 @@ define( [], function() { ...@@ -110,12 +118,16 @@ define( [], function() {
x++; x++;
} }
} ); } );
key = testKey; key = testKey;
return key; return key;
},
slugify: function( string ){
return jQuery.slugify( string, { separator: '_' } )
} }
}); });
return controller; return controller;
} ); } );
\ No newline at end of file
...@@ -75,7 +75,7 @@ define( [ ...@@ -75,7 +75,7 @@ define( [
* @return void * @return void
*/ */
addField: function( e ) { addField: function( e ) {
var type = jQuery( e.target ).data( 'id' ); var type = jQuery( e.target ).data( 'id' );
if( e.shiftKey ){ if( e.shiftKey ){
nfRadio.channel( 'fields' ).request( 'add:stagedField', type ); nfRadio.channel( 'fields' ).request( 'add:stagedField', type );
...@@ -121,7 +121,6 @@ define( [ ...@@ -121,7 +121,6 @@ define( [
* @return backbone.collection * @return backbone.collection
*/ */
getSavedFields: function() { getSavedFields: function() {
console.log( this.sections.get( 'saved' ) );
this.sections.get( 'saved' ); this.sections.get( 'saved' );
} }
}); });
......
/** /**
* Collection that holds our field models. * Collection that holds our field models.
* This is the actual field data created by the user. * This is the actual field data created by the user.
* *
* We listen to the add and remove events so that we can push the new id to either the new fields or removed fields property. * We listen to the add and remove events so that we can push the new id to either the new fields or removed fields property.
* *
* @package Ninja Forms builder * @package Ninja Forms builder
* @subpackage Fields * @subpackage Fields
* @copyright (c) 2015 WP Ninjas * @copyright (c) 2015 WP Ninjas
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
define( ['models/fields/fieldModel'], function( fieldModel ) { define( ['models/fields/fieldModel'], function( fieldModel ) {
var collection = Backbone.Collection.extend( { var collection = Backbone.Collection.extend( {
model: fieldModel, model: fieldModel,
comparator: 'order', comparator: function( model ){
return parseInt( model.get( 'order' ) );
},
tmpNum: 1, tmpNum: 1,
initialize: function() { initialize: function() {
...@@ -28,7 +30,7 @@ define( ['models/fields/fieldModel'], function( fieldModel ) { ...@@ -28,7 +30,7 @@ define( ['models/fields/fieldModel'], function( fieldModel ) {
/** /**
* When we add a field, push the id onto our new fields property. * When we add a field, push the id onto our new fields property.
* This lets us tell the server that this is a new field to be added rather than a field to be updated. * This lets us tell the server that this is a new field to be added rather than a field to be updated.
* *
* @since 3.0 * @since 3.0
* @param void * @param void
*/ */
...@@ -38,7 +40,7 @@ define( ['models/fields/fieldModel'], function( fieldModel ) { ...@@ -38,7 +40,7 @@ define( ['models/fields/fieldModel'], function( fieldModel ) {
/** /**
* When we remove a field, push the id onto our removed fields property. * When we remove a field, push the id onto our removed fields property.
* *
* @since 3.0 * @since 3.0
* @param void * @param void
*/ */
...@@ -55,9 +57,9 @@ define( ['models/fields/fieldModel'], function( fieldModel ) { ...@@ -55,9 +57,9 @@ define( ['models/fields/fieldModel'], function( fieldModel ) {
if ( 0 == this.length ) { if ( 0 == this.length ) {
var order = 0; var order = 0;
} else { } else {
var order = this.at( this.length -1 ).get( 'order' ) + 1; var order = this.at( this.length -1 ).get( 'order' ) + 1;
} }
model.set( 'order', order, { silent: true } ); model.set( 'order', order, { silent: true } );
this.add( model ); this.add( model );
}, },
...@@ -71,4 +73,4 @@ define( ['models/fields/fieldModel'], function( fieldModel ) { ...@@ -71,4 +73,4 @@ define( ['models/fields/fieldModel'], function( fieldModel ) {
} }
} ); } );
return collection; return collection;
} ); } );
\ No newline at end of file
...@@ -32,6 +32,13 @@ define( [], function() { ...@@ -32,6 +32,13 @@ define( [], function() {
} }
}, this ); }, this );
/*
* If our field type is a saved field, set our field type to the actual field type
*/
if ( 'saved' == fieldType.get( 'section' ) ) {
this.set( 'type', fieldType.get( 'type' ) );
}
/* /*
* Trigger an init event on three channels: * Trigger an init event on three channels:
* *
......
...@@ -2,7 +2,20 @@ define( [], function() { ...@@ -2,7 +2,20 @@ define( [], function() {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
tagName: 'div', tagName: 'div',
className: 'nf-error', className: 'nf-error',
template: '#tmpl-nf-edit-setting-option-repeater-error' template: '#tmpl-nf-edit-setting-option-repeater-error',
templateHelpers: function() {
var that = this;
return {
renderErrors: function() {
if ( 'undefined' != typeof that.errors ) {
return that.errors[ Object.keys( errors )[0] ];
} else {
return '';
}
}
}
}
}); });
return view; return view;
......
...@@ -28,7 +28,7 @@ define([], function() { ...@@ -28,7 +28,7 @@ define([], function() {
var selected = _.filter( model.get( 'options' ), function( opt ) { return 1 == opt.selected } ); var selected = _.filter( model.get( 'options' ), function( opt ) { return 1 == opt.selected } );
selected = _.map( selected, function( opt ) { return opt.value } ); selected = _.map( selected, function( opt ) { return opt.value } );
var value = selected; var value = selected;
} else { } else if ( 'listradio' !== model.get( 'type' ) ) {
/* /*
* Check to see if we have a selected value. * Check to see if we have a selected value.
*/ */
......
...@@ -64,6 +64,13 @@ define([], function() { ...@@ -64,6 +64,13 @@ define([], function() {
return false; return false;
} }
/*
* Send out a radio message saying that we're about to begin submitting.
* First we send on the generic forms channel, and then on the form-specific channel.
*/
nfRadio.channel( 'forms' ).trigger( 'after:submitValidation', formModel );
nfRadio.channel( 'form-' + formModel.get( 'id' ) ).trigger( 'after:submitValidation', formModel );
/* /*
* Actually submit our form, and send out a message with our response. * Actually submit our form, and send out a message with our response.
*/ */
......
...@@ -19,6 +19,15 @@ define([], function() { ...@@ -19,6 +19,15 @@ define([], function() {
} ); } );
} }
if ( 'undefined' != typeof response.errors.last ) {
if( 'undefined' != typeof response.errors.last.message ) {
var style = 'background: rgba( 255, 207, 115, .5 ); color: #FFA700; display: block;';
console.log( '%c NINJA FORMS SUPPORT: SERVER ERROR', style );
console.log( response.errors.last.message );
console.log( '%c END SERVER ERROR MESSAGE', style );
}
}
/** /**
* TODO: This needs to be re-worked for backbone. It's not dynamic enough. * TODO: This needs to be re-worked for backbone. It's not dynamic enough.
*/ */
...@@ -31,4 +40,4 @@ define([], function() { ...@@ -31,4 +40,4 @@ define([], function() {
}); });
return controller; return controller;
} ); } );
\ No newline at end of file
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.
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 { ...@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version // Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) ) if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.24' ); define( 'NF_PLUGIN_VERSION', '3.0.25' );
// Plugin Folder Path // Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) ) if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
...@@ -363,7 +363,13 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller ...@@ -363,7 +363,13 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
{ {
$error = error_get_last(); $error = error_get_last();
if( $error !== NULL && in_array( $error[ 'type' ], array( E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR ) ) ) { if( $error !== NULL && in_array( $error[ 'type' ], array( E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR ) ) ) {
$this->_errors[ 'form' ][ 'last' ] = __( 'The server encountered an error during processing.', 'ninja-forms' ); $this->_errors[ 'form' ][ 'last' ] = __( 'The server encountered an error during processing.', 'ninja-forms' );
if( current_user_can( 'manage_options' ) && isset( $error[ 'message' ] ) ){
$this->_errors[ 'form' ][ 'last_admin' ] = '<pre>' . $error[ 'message' ] . '</pre>';
}
$this->_errors[ 'last' ] = $error; $this->_errors[ 'last' ] = $error;
$this->_respond(); $this->_respond();
} }
...@@ -389,4 +395,4 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller ...@@ -389,4 +395,4 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
if( ! isset( $this->_form_data[ 'settings' ][ 'is_preview' ] ) ) return false; if( ! isset( $this->_form_data[ 'settings' ][ 'is_preview' ] ) ) return false;
return $this->_form_data[ 'settings' ][ 'is_preview' ]; return $this->_form_data[ 'settings' ][ 'is_preview' ];
} }
} }
\ No newline at end of file
...@@ -287,7 +287,7 @@ abstract class NF_Abstracts_Field ...@@ -287,7 +287,7 @@ abstract class NF_Abstracts_Field
public static function sort_by_order( $a, $b ) public static function sort_by_order( $a, $b )
{ {
return strcmp( $a->get_setting( 'order' ), $b->get_setting( 'order' ) ); return $a->get_setting( 'order' ) - $b->get_setting( 'order' );
} }
public function localize_settings( $settings, $form_id ) { public function localize_settings( $settings, $form_id ) {
......
...@@ -38,9 +38,11 @@ abstract class NF_Abstracts_List extends NF_Abstracts_Field ...@@ -38,9 +38,11 @@ abstract class NF_Abstracts_List extends NF_Abstracts_Field
$field = Ninja_Forms()->form()->get_field( $id ); $field = Ninja_Forms()->form()->get_field( $id );
$options = '<option>--</option>'; $options = '<option>--</option>';
foreach( $field->get_setting( 'options' ) as $option ){ if ( is_array( $field->get_setting( 'options' ) ) ) {
$selected = ( $value == $option[ 'value' ] ) ? "selected" : ''; foreach( $field->get_setting( 'options' ) as $option ){
$options .= "<option value='{$option[ 'value' ]}' $selected>{$option[ 'label' ]}</option>"; $selected = ( $value == $option[ 'value' ] ) ? "selected" : '';
$options .= "<option value='{$option[ 'value' ]}' $selected>{$option[ 'label' ]}</option>";
}
} }
return "<select class='widefat' name='fields[$id]' id=''>$options</select>"; return "<select class='widefat' name='fields[$id]' id=''>$options</select>";
......
...@@ -20,6 +20,11 @@ class NF_Abstracts_ModelFactory ...@@ -20,6 +20,11 @@ class NF_Abstracts_ModelFactory
*/ */
protected $_object; protected $_object;
/**
* Form
*/
protected $_form;
/** /**
* Fields * Fields
* *
...@@ -60,7 +65,7 @@ class NF_Abstracts_ModelFactory ...@@ -60,7 +65,7 @@ class NF_Abstracts_ModelFactory
{ {
$this->_db = $db; $this->_db = $db;
$this->_object = new NF_Database_Models_Form( $this->_db, $id ); $this->_object = $this->_form = new NF_Database_Models_Form( $this->_db, $id );
$form_cache = get_option( 'nf_form_' . $id, false ); $form_cache = get_option( 'nf_form_' . $id, false );
...@@ -78,7 +83,9 @@ class NF_Abstracts_ModelFactory ...@@ -78,7 +83,9 @@ class NF_Abstracts_ModelFactory
*/ */
public function get() public function get()
{ {
return $this->_object; $object = $this->_object;
$this->_object = $this->_form;
return $object;
} }
/** /**
...@@ -121,6 +128,7 @@ class NF_Abstracts_ModelFactory ...@@ -121,6 +128,7 @@ class NF_Abstracts_ModelFactory
public function import_form( $import, $id = FALSE, $is_conversion = FALSE ) public function import_form( $import, $id = FALSE, $is_conversion = FALSE )
{ {
if( ! is_array( $import ) ){ if( ! is_array( $import ) ){
$data = WPN_Helper::utf8_decode( json_decode( html_entity_decode( $import ), true ) ); $data = WPN_Helper::utf8_decode( json_decode( html_entity_decode( $import ), true ) );
if( ! is_array( $data ) ) { if( ! is_array( $data ) ) {
...@@ -128,7 +136,7 @@ class NF_Abstracts_ModelFactory ...@@ -128,7 +136,7 @@ class NF_Abstracts_ModelFactory
} }
if( ! is_array( $data ) ){ if( ! is_array( $data ) ){
$data = maybe_unserialize( $import ); $data = WPN_Helper::maybe_unserialize( $import );
if( ! is_array( $data ) ){ if( ! is_array( $data ) ){
return false; return false;
...@@ -181,9 +189,12 @@ class NF_Abstracts_ModelFactory ...@@ -181,9 +189,12 @@ class NF_Abstracts_ModelFactory
*/ */
public function get_fields( $where = array(), $fresh = FALSE) public function get_fields( $where = array(), $fresh = FALSE)
{ {
if( $where || $fresh || ! $this->_fields ){
$form_id = $this->_object->get_id(); $field_by_key = array();
$form_id = $this->_object->get_id();
if( $where || $fresh || ! $this->_fields ){
$form_cache = get_option( 'nf_form_' . $form_id, false ); $form_cache = get_option( 'nf_form_' . $form_id, false );
...@@ -194,17 +205,32 @@ class NF_Abstracts_ModelFactory ...@@ -194,17 +205,32 @@ class NF_Abstracts_ModelFactory
foreach ($fields as $field) { foreach ($fields as $field) {
$this->_fields[$field->get_id()] = $field; $this->_fields[$field->get_id()] = $field;
$field_by_key[ $field->get_setting( 'key' ) ] = $field;
} }
} else { } else {
foreach( $form_cache[ 'fields' ] as $cached_field ){ foreach( $form_cache[ 'fields' ] as $cached_field ){
$field = Ninja_Forms()->form( $form_id )->get_field( $cached_field[ 'id' ] ); $field = Ninja_Forms()->form( $form_id )->get_field( $cached_field[ 'id' ] );
$field->update_settings( $cached_field[ 'settings' ] ); $field->update_settings( $cached_field[ 'settings' ] );
$this->_fields[$field->get_id()] = $field; $this->_fields[$field->get_id()] = $field;
$field_by_key[ $field->get_setting( 'key' ) ] = $field;
} }
} }
/*
* If a filter is registered to modify field order, then use that filter.
* If not, then usort??.
*/
$order = apply_filters( 'ninja_forms_get_fields_sorted', array(), $this->_fields, $field_by_key, $form_id );
if ( ! empty( $order ) ) {
$this->_fields = $order;
}
} }
usort( $this->_fields, "NF_Abstracts_Field::sort_by_order" ); /*
* Broke the sub edit screen order when I have this enabled.
*/
// usort( $this->_fields, "NF_Abstracts_Field::sort_by_order" );
return $this->_fields; return $this->_fields;
} }
...@@ -385,15 +411,15 @@ class NF_Abstracts_ModelFactory ...@@ -385,15 +411,15 @@ class NF_Abstracts_ModelFactory
* @param bool|FALSE $fresh * @param bool|FALSE $fresh
* @return array * @return array
*/ */
public function get_subs( $where = array(), $fresh = FALSE ) public function get_subs( $where = array(), $fresh = FALSE, $sub_ids = array() )
{ {
if( $where || $fresh || ! $this->_objects ){ if( $where || $fresh || $sub_ids || ! $this->_objects ){
$form_id = $this->_object->get_id(); $form_id = $this->_object->get_id();
$model_shell = new NF_Database_Models_Submission( 0 ); $model_shell = new NF_Database_Models_Submission( 0 );
$objects = $model_shell->find( $form_id, $where ); $objects = $model_shell->find( $form_id, $where, $sub_ids );
foreach( $objects as $object ){ foreach( $objects as $object ){
$this->_objects[ $object->get_id() ] = $object; $this->_objects[ $object->get_id() ] = $object;
......
...@@ -17,6 +17,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing { ...@@ -17,6 +17,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
} }
public function loading() { public function loading() {
$subs_per_step = apply_filters( 'ninja_forms_export_subs_per_step', 10 );
$form_id = isset( $this->args['form_id'] ) ? absint( $this->args['form_id'] ) : 0; $form_id = isset( $this->args['form_id'] ) ? absint( $this->args['form_id'] ) : 0;
if ( empty( $form_id ) ) { if ( empty( $form_id ) ) {
...@@ -27,7 +28,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing { ...@@ -27,7 +28,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
$sub_count = $this->get_sub_count( $form_id ); $sub_count = $this->get_sub_count( $form_id );
if( empty( $this->total_steps ) || $this->total_steps <= 1 ) { if( empty( $this->total_steps ) || $this->total_steps <= 1 ) {
$this->total_steps = round( ( $sub_count / 250 ), 0 ) + 2; $this->total_steps = round( ( $sub_count / $subs_per_step ), 0 ) + 2;
} }
$args = array( $args = array(
...@@ -47,6 +48,8 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing { ...@@ -47,6 +48,8 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
wp_die( __( 'Invalid form id', 'ninja-forms' ) ); wp_die( __( 'Invalid form id', 'ninja-forms' ) );
} }
$subs_per_step = apply_filters( 'ninja_forms_export_subs_per_step', 10 );
$this->args[ 'filename' ] = wp_kses_post( $this->args[ 'filename' ] ); $this->args[ 'filename' ] = wp_kses_post( $this->args[ 'filename' ] );
$exported_subs = get_user_option( get_current_user_id(), 'nf_download_all_subs_ids' ); $exported_subs = get_user_option( get_current_user_id(), 'nf_download_all_subs_ids' );
...@@ -60,7 +63,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing { ...@@ -60,7 +63,7 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
} }
$args = array( $args = array(
'posts_per_page' => 250, 'posts_per_page' => $subs_per_step,
'paged' => $this->step, 'paged' => $this->step,
'post_type' => 'nf_sub', 'post_type' => 'nf_sub',
'meta_query' => array( 'meta_query' => array(
......
...@@ -142,8 +142,7 @@ class NF_Admin_CPT_Submission ...@@ -142,8 +142,7 @@ class NF_Admin_CPT_Submission
$form_cache = get_option( 'nf_form_' . $form_id ); $form_cache = get_option( 'nf_form_' . $form_id );
$form_fields = $form_cache[ 'fields' ]; $form_fields = Ninja_Forms()->form( $form_id )->get_fields();
if( empty( $form_fields ) ) $form_fields = Ninja_Forms()->form( $form_id )->get_fields();
foreach( $form_fields as $field ) { foreach( $form_fields as $field ) {
...@@ -264,8 +263,6 @@ class NF_Admin_CPT_Submission ...@@ -264,8 +263,6 @@ class NF_Admin_CPT_Submission
$fields = Ninja_Forms()->form( $form_id )->get_fields(); $fields = Ninja_Forms()->form( $form_id )->get_fields();
usort( $fields, array( $this, 'sort_fields' ) );
$hidden_field_types = apply_filters( 'nf_sub_hidden_field_types', array() ); $hidden_field_types = apply_filters( 'nf_sub_hidden_field_types', array() );
Ninja_Forms::template( 'admin-metabox-sub-fields.html.php', compact( 'fields', 'sub', 'hidden_field_types' ) ); Ninja_Forms::template( 'admin-metabox-sub-fields.html.php', compact( 'fields', 'sub', 'hidden_field_types' ) );
......