From f24f42a26a1b7b00bed20517fb5fa642a43921a3 Mon Sep 17 00:00:00 2001 From: zach-adams Date: Wed, 13 Sep 2023 11:04:54 -0600 Subject: [PATCH 1/2] Check if entry/lead ID is empty in "gform_post_note_added" action & return early if it is --- connectors/class-connector-gravityforms.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectors/class-connector-gravityforms.php b/connectors/class-connector-gravityforms.php index 667aca24d..f7f1e9d8a 100644 --- a/connectors/class-connector-gravityforms.php +++ b/connectors/class-connector-gravityforms.php @@ -672,6 +672,11 @@ public function callback_gform_post_note_added( $note_id, $lead_id, $user_id, $u unset( $note ); unset( $note_type ); + // Skip if no entry/lead id (e.g. Save and Continue notifications) + if( empty( $lead_id ) ) { + return; + } + $lead = \GFFormsModel::get_lead( $lead_id ); $form = $this->get_form( $lead['form_id'] ); From 697d1551baaf30602c821ed498e8e4624b330259 Mon Sep 17 00:00:00 2001 From: zach-adams Date: Wed, 13 Sep 2023 12:44:52 -0600 Subject: [PATCH 2/2] Spacing update --- connectors/class-connector-gravityforms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectors/class-connector-gravityforms.php b/connectors/class-connector-gravityforms.php index f7f1e9d8a..aa68ba5b7 100644 --- a/connectors/class-connector-gravityforms.php +++ b/connectors/class-connector-gravityforms.php @@ -673,7 +673,7 @@ public function callback_gform_post_note_added( $note_id, $lead_id, $user_id, $u unset( $note_type ); // Skip if no entry/lead id (e.g. Save and Continue notifications) - if( empty( $lead_id ) ) { + if ( empty( $lead_id ) ) { return; }