Apr 14th, 2010, 5:53 AM
bug fix: api.php: ft_api_process_form: line 846
I'd like to display a message without redirecting upon a successful form submission but the notification emails aren't sent unless the "next_page" variable is populated forcing a redirect.
Before
After
I'd like to display a message without redirecting upon a successful form submission but the notification emails aren't sent unless the "next_page" variable is populated forcing a redirect.
Before
Code:
if ($passes_captcha && !empty($next_page) && !$is_deleting_file)
{
// if the user wasn't putting through a test submission or initializing the form, we can send safely
// send emails at this juncture, but ONLY if it was just finalized
if ($form_id != "test" && $submission_id != "test" && !isset($_SESSION[$namespace]["form_tools_initialize_form"])
&& !isset($form_data["form_tools_ignore_submission"]))
{
// send any emails attached to the on_submission trigger
if ($is_finalized == "yes")
ft_send_emails("on_submission", $form_id, $submission_id);
}
header("location: $next_page");
exit;
}
After
Code:
if ($passes_captcha && !$is_deleting_file)
{
// if the user wasn't putting through a test submission or initializing the form, we can send safely
// send emails at this juncture, but ONLY if it was just finalized OR if the send_emails parameter
// allows for it
if ($form_id != "test" && $submission_id != "test" && !isset($_SESSION[$namespace]["form_tools_initialize_form"])
&& !isset($form_data["form_tools_ignore_submission"]))
{
// send any emails attached to the on_submission trigger
if (isset($params["send_emails"]) && $params["send_emails"] === true)
ft_send_emails("on_submission", $form_id, $submission_id);
else if ($is_finalized == "yes" && (!isset($params["send_emails"]) || $params["send_emails"] !== false))
ft_send_emails("on_submission", $form_id, $submission_id);
}
if(!empty($next_page))
{
header("location: $next_page");
exit;
}
}