Commit 9b2b8d3c authored by KR Moorhouse's avatar KR Moorhouse

Updated error resonse to be less generic on encode failure. Corrected error in...

Updated error resonse to be less generic on encode failure. Corrected error in loop to prevent throwing unnecessary errors.
parent 776f24a1
Pipeline #1068 failed with stages
in 0 seconds
......@@ -103,7 +103,7 @@ class NF_Admin_Processes_ImportForm extends NF_Abstracts_BatchProcess
}
if ( ! is_array( $data ) ) {
$this->add_error( 'decode_failed', __( 'Something went wrong. Please try again.', 'ninja-forms' ), 'fatal' );
$this->add_error( 'decode_failed', __( 'Failed to read export. Please try again.', 'ninja-forms' ), 'fatal' );
$this->batch_complete();
}
......@@ -393,7 +393,10 @@ class NF_Admin_Processes_ImportForm extends NF_Abstracts_BatchProcess
if ( ! isset ( $this->form[ 'fields' ][ $i ] ) ) {
// Remove this field from our fields array.
unset( $this->form[ 'fields' ][ $i ] );
$this->add_error( 'empty_field', __( 'Some fields might not have been imported properly.', 'ninja-forms' ) );
// If we haven't exceeded the field total...
if ( $i < count( $this->form[ 'fields' ] ) ) {
$this->add_error( 'empty_field', __( 'Some fields might not have been imported properly.', 'ninja-forms' ) );
}
continue;
}
......
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