From 859ad1881c51c3a0e1e9753b9c1c8750d8d14907 Mon Sep 17 00:00:00 2001
From: Christian Wach <needle@haystack.co.uk>
Date: Fri, 1 Nov 2024 13:53:35 +0000
Subject: [PATCH] Enable new ACFE action in redirect action

---
 .../acfe-0.9.x/class-cfafa-form-action-redirect.php        | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/includes/form-actions/acfe-0.9.x/class-cfafa-form-action-redirect.php b/includes/form-actions/acfe-0.9.x/class-cfafa-form-action-redirect.php
index 2a2dd5d..1e7d028 100644
--- a/includes/form-actions/acfe-0.9.x/class-cfafa-form-action-redirect.php
+++ b/includes/form-actions/acfe-0.9.x/class-cfafa-form-action-redirect.php
@@ -148,18 +148,21 @@ class CFAFA_ACFE_Form_Action_Redirect extends CFAFA_ACFE_Form_Action_Base {
 		}
 
 		/**
-		 * Fire the ACF Extended 0.8.x action.
+		 * Fires the ACF Extended 0.9.x success action.
 		 *
 		 * This is to allow any plugins that perform administrative tasks (e.g. saving
 		 * form submissions) to act before the redirect.
 		 *
+		 * Note that `acfe/form/submit_form` cannot be fired here because doing so
+		 * causes recursive calls to `make_action()`.
+		 *
 		 * @see https://develop.tadpole.cc/plugins/submission-logs-for-acfe
 		 *
 		 * @since 0.2.0
 		 *
 		 * @param array $form The array of Form data.
-		do_action( 'acfe/form/submit_form', $form );
 		 */
+		do_action( 'acfe/form/submit_success', $form );
 
 		// Do the redirect.
 		wp_safe_redirect( $redirect_data['redirect_url'] );
-- 
GitLab