Commit 6bcced25 authored by KR Moorhouse's avatar KR Moorhouse

Updated export functionality to confirm fields and actions are actually valid...

Updated export functionality to confirm fields and actions are actually valid objects before trying to call the get_settings method.
parent 6b8b1f5e
......@@ -347,13 +347,19 @@ final class NF_Database_Models_Form extends NF_Abstracts_Model
$fields = Ninja_Forms()->form( $form_id )->get_fields();
foreach( $fields as $field ){
$export['fields'][] = $field->get_settings();
// If the field is set.
if ( ! is_null( $field ) && ! empty( $field ) ) {
$export['fields'][] = $field->get_settings();
}
}
$actions = Ninja_Forms()->form( $form_id )->get_actions();
foreach( $actions as $action ){
$export[ 'actions' ][] = $action->get_settings();
// If the action is set.
if ( ! is_null( $action ) && ! empty( $action ) ) {
$export[ 'actions' ][] = $action->get_settings();
}
}
if( $return ){
......
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