Commit 80210d3d authored by KR Moorhouse's avatar KR Moorhouse

Resolved merge conflicts.

parents 6e6b881d 0167df1d
......@@ -222,10 +222,14 @@ define( [], function() {
}
} ).fail( function( xhr, status, error ) {
console.log( xhr.status );
console.log( error );
console.log( action );
// For previews, only log to the console.
if( 'preview' == action ) {
console.log( error );
return;
}
// @todo Convert alert to jBox Modal.
alert( xhr.status + ' ' + error + '\r\n' + 'An error on the server caused your form not to publish.\r\nPlease contact Ninja Forms Support with your PHP Error Logs.\r\nhttps://ninjaforms.com/contact' );
alert(xhr.status + ' ' + error + '\r\n' + 'An error on the server caused your form not to publish.\r\nPlease contact Ninja Forms Support with your PHP Error Logs.\r\nhttps://ninjaforms.com/contact');
});
},
......
......@@ -46,8 +46,14 @@ define([], function() {
var validate = nfRadio.channel( 'forms' ).request( 'maybe:validate', formModel );
if( false !== validate ){
// When validating all fields, set clean to false to force validation.
_.each( formModel.get( 'fields' ).models, function( fieldModel ) {
fieldModel.set( 'clean', false );
} );
/*
* This method is defined in our models/fieldCollection.js file.
* This method is defined in our models/fieldCollection.js file,
* except where overridden by an add-on (ie Layout & Styles).
*/
formModel.get( 'formContentData' ).validateFields();
}
......
......@@ -49,6 +49,7 @@ define([], function() {
},
validateModelData: function( model ) {
if ( 1 != model.get( 'required' ) || ! model.get( 'visible' ) || model.get( 'clean' ) ) {
return false;
}
......
......@@ -12,8 +12,6 @@ define( ['models/fieldModel'], function( fieldModel ) {
validateFields: function() {
_.each( this.models, function( fieldModel ) {
// When validating all fields, set clean to false to force validation.
fieldModel.set( 'clean', false );
nfRadio.channel( 'submit' ).trigger( 'validate:field', fieldModel );
}, this );
},
......
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 diff is collapsed.
......@@ -127,6 +127,14 @@ class NF_Abstracts_ModelFactory
*/
public function import_form( $import, $id = FALSE, $is_conversion = FALSE )
{
/*
* Remove any unwated (corrupted?) characters from either side of our object.
*/
$l_trim = strpos( $import, '{' );
$r_trim = strrpos( $import, '}' ) - $l_trim + 1;
$import = substr( $import, $l_trim, $r_trim );
if( ! is_array( $import ) ){
$data = WPN_Helper::utf8_decode( json_decode( html_entity_decode( $import ), true ) );
......
......@@ -61,7 +61,7 @@ final class NF_Actions_CollectPayment extends NF_Abstracts_Action
$payment_gateway_class = $this->payment_gateways[ $payment_gateway ];
/*
* Get our payment total.
* Get our payment total if we have old data. (not used in current version)
*
* If we have selected "Calc" as our total type, then we want to use payment_total_calc
*
......
......@@ -141,8 +141,9 @@ final class NF_Actions_Email extends NF_Abstracts_Action
// Loop over our email addresses.
foreach( $email_addresses as $email ) {
// Updated to trim values in case there is a value with spaces/tabs/etc to remove whitespace
if( empty( trim( $email ) ) ) continue;
// Updated to trim values in case there is a value with spaces/tabs/etc to remove whitespace
$email = trim( $email );
if ( empty( $email ) ) continue;
// Build our array of the email addresses.
$sanitized_array[] = $email;
......
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