Support

Home Forums Event Espresso Premium Registration Form/Page: My custom submit action is only being called one time

Registration Form/Page: My custom submit action is only being called one time

Posted: September 15, 2020 at 8:12 pm


mbeede@tracom.com

September 15, 2020 at 8:12 pm

Tony – This is somewhat related to other support topics you have been helping me with over the last 2 weeks. I discovered something new… On my Registration page when the user hits the Submit button I need to do some back-end PHP processing including calling an external web service method on another system.

To do this I have created my own plugin. In my PHP file I have added a new action that allows me to do additional submit processing like this:

add_action(‘AHEE__EE_Single_Page_Checkout__process_attendee_information__end’,’my_custom_submit_action’, 10, 2);
function my_custom_submit_action( $spco, $data)
{
// Do a bunch of stuff including a web service call, field error checking, etc.
}

SO now a user goes to the registration form, fills out all of the fields, but puts invalid input in for one of the fields. The user hits the submit button. My custom action (above) is called, the error is detected in my code, and I call the EE_Error:add_error method to display the error.

The user corrects the field in error and hits the submit button again. What I am seeing is that my custom action IS NOT being called again at all. It’s only called the first time. I have verified this with debug statements in the code. Instead EE is taking a different path and displaying the Thank You page instead which creates big issues for me.

I need for my custom submit action to be called EVERY TIME the user hits the Submit button on the Registration page otherwise a bunch of things don’t work right, some of which you have been trying to help me with (redirects, etc.).

Can you tell me why my custom submit action is only being called the first time by the EE code, but not again on a subsequent Submit? And can this be fixed to work the way I need it to work? Modify a template, whatever…

THANKS IN ADVANCE!!! – Mark


mbeede@tracom.com

September 16, 2020 at 10:46 am

Tony – I’m doing some more testing on this. I changed the theme to the 2019 WP standard theme and I still see the same behavior. My custom action is only being called the first time on the first submit, but not on any subsequent submits. I wanted to make sure to rule out our theme as a potential suspect.


mbeede@tracom.com

September 17, 2020 at 2:29 pm

Good afternoon – If someone could take a look at this I would really appreciate it OR if you are not able to for some reason could you PLEASE just let me know.

I am in the process of setting up a local development environment for my website so that I can interactively debug the EE code for this issue BUT you could potentially save me a LOT of time if you can help me out at all.

Have a good day – Mark

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  mbeede@tracom.com 6 days, 18 hours ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!