Commit 4e38a21b authored by Kevin Stover's avatar Kevin Stover

Merge branch 'patch-1' into 'develop'

Update Submission.php to avoid notice on empty Ninja_Forms()->actions[ $type ]

See merge request ninja-forms/ninja-forms!3656
parents 43f61ae0 d4450c14
......@@ -352,12 +352,19 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
if( ! is_string( $type ) ) continue;
$action_class = Ninja_Forms()->actions[ $type ];
if( ! method_exists( $action_class, 'process' ) ) continue;
if( $data = $action_class->process($action[ 'settings' ], $this->_form_id, $this->_data ) ){
$this->_data = apply_filters( 'ninja_forms_post_run_action_type_' . $action[ 'settings' ][ 'type' ], $data );
/*
* test if Ninja_Forms()->actions[ $type ] is not empty
*/
if(isset(Ninja_Forms()->actions[ $type ]))
{
$action_class = Ninja_Forms()->actions[ $type ];
if( ! method_exists( $action_class, 'process' ) ) continue;
if( $data = $action_class->process($action[ 'settings' ], $this->_form_id, $this->_data ) )
{
$this->_data = apply_filters( 'ninja_forms_post_run_action_type_' . $action[ 'settings' ][ 'type' ], $data );
}
}
// $this->_data[ 'actions' ][ $type ][] = $action;
......
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