Forms do not redirect - just freeze - but gets submitted in background

Hi, I’m experiencing a weird issue this week with a form that have worked just nicely before. In short, when submitting, the confirmation options do not work (neither text, page or redirect), the spinner is just spinning but the form gets submitted and all my background logic performs as expected.

I’ve done some research in addition to above:

  • I’ve tried to locate if there are any other plugins that are connected to the same filter for the form (gform_confirmation) but haven’t found any.

  • I cannot see any headers being sent that could conflict with the form either.

  • Just before I return the $confirmation variable in my custom function connected to the filter, I execute some process functions, with two CURL-calls to external services (SMS and PDF).

  • I have also tried to follow the execution in the backend in form_display.php with Xdebug and it looks as I believe it should look.

  • (Edit 2025-04-01): I have been able to isolate the issue as follows:
    a) I have taken out all heavy postprocessing from my custom function connected to gform_confirmation. It basically just returns the $confirmation variable with redirect set to a page.
    b) When I do this, the form submits and redirects nicely and exactly as expected
    c) However, same scenario, if I set a breakpoint in Xdebug/VS Code on the line that returns the $confirmation variable, and just silently observe for 5-6 seconds and then resume execution, the page doesn’t redirect.
    d) I’ve set breakpoints on other redirects etc in my code-base but I cannot see anything should interfere with the redirect, although I’m certain there is something that prevents the header to be sent. I don’t believe its an error in the GF product!

Any idea where I can look to resolve this issue?Many thanks in advance.
/Christian
PS sending the log below: DS

2025-03-31 19:15:08.722537 - DEBUG --> GFFormDisplay::process_form(): Starting to process form (#41) submission. 
2025-03-31 19:15:08.729784 - DEBUG --> GFFormDisplay::process_form(): Executing functions hooked to gform_pre_process. 
2025-03-31 19:15:08.773170 - DEBUG --> GFFormDisplay::process_form(): Completed gform_pre_process. 
2025-03-31 19:15:08.774424 - DEBUG --> GFFormDisplay::process_form(): Source page number: 1. Target page number: 0. 
2025-03-31 19:15:08.774605 - DEBUG --> GFFormDisplay::validate(): Starting for form #41. 
2025-03-31 19:15:08.774782 - DEBUG --> GFFormDisplay::validate(): Executing functions hooked to gform_pre_validation. 
2025-03-31 19:15:08.820859 - DEBUG --> GFFormDisplay::validate(): Completed gform_pre_validation. 
2025-03-31 19:15:08.821031 - DEBUG --> GFFormDisplay::validate(): Checking restrictions. 
2025-03-31 19:15:08.821468 - DEBUG --> GFFormDisplay::validate(): Completed restrictions. Starting field validation. 
2025-03-31 19:15:08.821778 - DEBUG --> GFFormDisplay::validate_character_encoding(): Starting invalid characters validation for field: Namn (1 - text) 
2025-03-31 19:15:08.822385 - DEBUG --> GFFormDisplay::validate_character_encoding(): gf_entry_meta meta_value charset = utf8mb4 
2025-03-31 19:15:08.822565 - DEBUG --> GFFormDisplay::validate_character_encoding(): reflecting methods 
2025-03-31 19:15:08.822752 - DEBUG --> GFFormDisplay::validate_character_encoding(): Completed in 0.000981 seconds. Value is valid ascii 
2025-03-31 19:15:08.823122 - DEBUG --> GFFormDisplay::validate_character_encoding(): Starting invalid characters validation for field: Adress-1 (3 - text) 
2025-03-31 19:15:08.823412 - DEBUG --> GFFormDisplay::validate_character_encoding(): Completed in 0.000287 seconds. 
2025-03-31 19:15:08.823925 - DEBUG --> GFFormDisplay::validate_character_encoding(): Starting invalid characters validation for field: Postnr (5 - text) 
2025-03-31 19:15:08.824100 - DEBUG --> GFFormDisplay::validate_character_encoding(): Completed in 0.000176 seconds. Value is valid ascii 
2025-03-31 19:15:08.824445 - DEBUG --> GFFormDisplay::validate_character_encoding(): Starting invalid characters validation for field: Stad (6 - text) 
2025-03-31 19:15:08.824639 - DEBUG --> GFFormDisplay::validate_character_encoding(): Completed in 0.000193 seconds. 
2025-03-31 19:15:08.841897 - DEBUG --> GFFormDisplay::validate(): Field validation completed in 0.020233 seconds. 
2025-03-31 19:15:08.842091 - DEBUG --> GFFormDisplay::validate(): Executing functions hooked to gform_validation. 
2025-03-31 19:15:08.851524 - DEBUG --> GFFormsModel::create_lead(): Draft entry created for form (#41) in 0.009206 seconds. 
2025-03-31 19:15:12.908294 - DEBUG --> GFFormDisplay::validate(): Completed gform_validation. 
2025-03-31 19:15:12.909126 - DEBUG --> GFFormDisplay::process_form(): After validation. Is submission valid? Yes. 
2025-03-31 19:15:12.910087 - DEBUG --> GFFormDisplay::process_form(): Submission is valid. Moving forward. 
2025-03-31 19:15:12.910900 - DEBUG --> GFFormDisplay::process_form(): Executing functions hooked to gform_pre_submission. 
2025-03-31 19:15:12.914433 - DEBUG --> GFFormDisplay::process_form(): Completed gform_pre_submission. 
2025-03-31 19:15:12.915628 - DEBUG --> GFFormDisplay::process_form(): Executing functions hooked to gform_pre_submission_filter. 
2025-03-31 19:15:13.006923 - DEBUG --> GFFormDisplay::process_form(): Completed gform_pre_submission_filter. 
2025-03-31 19:15:13.007293 - DEBUG --> GFFormsModel::save_entry(): Saving entry. 
2025-03-31 19:15:13.010596 - DEBUG --> GFFormsModel::save_entry(): Entry record created in the database. ID: 11849. 
2025-03-31 19:15:13.011390 - DEBUG --> GFFormsModel::save_entry(): Saving entry fields. 
2025-03-31 19:15:13.011936 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Namn(#1 - text). 
2025-03-31 19:15:13.012434 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Adress-1(#3 - text). 
2025-03-31 19:15:13.012900 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Adress-2(#4 - text). 
2025-03-31 19:15:13.013372 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Postnr(#5 - text). 
2025-03-31 19:15:13.013843 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Stad(#6 - text). 
2025-03-31 19:15:13.014307 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Land(#7 - select). 
2025-03-31 19:15:13.014892 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Skickas som:(#12 - radio). 
2025-03-31 19:15:13.015364 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Epostadress(#13 - email). 
2025-03-31 19:15:13.015836 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Telefonnr för SMS(#14 - phone). 
2025-03-31 19:15:13.016309 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Personnr för KIVRA(#15 - text). 
2025-03-31 19:15:13.016891 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Skickas som(#19 - radio). 
2025-03-31 19:15:13.017355 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Epostadress(#20 - email). 
2025-03-31 19:15:13.017842 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Telefonnr för SMS(#21 - phone). 
2025-03-31 19:15:13.018301 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Personnr för KIVRA(#22 - text). 
2025-03-31 19:15:13.018906 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Föreningen får skicka SMS till mig i brådskande ärenden(#48 - radio). 
2025-03-31 19:15:13.019402 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Används ej (rendering)(#51 - email). 
2025-03-31 19:15:13.019915 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Telefonnr för SMS i brådskande ärenden(#49 - phone). 
2025-03-31 19:15:13.020406 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Används ej (rendering)(#53 - text). 
2025-03-31 19:15:13.021035 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Jag är klar och vill spara(#28.1 - checkbox). 
2025-03-31 19:15:13.021557 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Mitt telefonr för SMS-länk(#29 - phone). 
2025-03-31 19:15:13.022056 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Mitt personnr för digital signering(#30 - text). 
2025-03-31 19:15:13.022579 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Invcfefid(#32 - hidden). 
2025-03-31 19:15:13.023093 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Invedinr(#33 - hidden). 
2025-03-31 19:15:13.023607 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Editmode(#34 - hidden). 
2025-03-31 19:15:13.024106 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Lockid(#35 - hidden). 
2025-03-31 19:15:13.024616 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Sessid(#36 - hidden). 
2025-03-31 19:15:13.025135 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Site(#37 - hidden). 
2025-03-31 19:15:13.025650 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Kundid(#38 - hidden). 
2025-03-31 19:15:13.026151 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Orgnr(#39 - hidden). 
2025-03-31 19:15:13.026671 - DEBUG --> GFFormsModel::queue_save_input_value(): Queued field operation: Hasonk(#43 - hidden). 
2025-03-31 19:15:13.034557 - DEBUG --> GFFormsModel::save_entry(): Finished saving entry fields. 
2025-03-31 19:15:13.034753 - DEBUG --> GFFormsModel::save_entry(): Saving entry completed in 0.027463 seconds. 
2025-03-31 19:15:13.045896 - DEBUG --> GFFormsModel::set_entry_meta(): Saving meta for entry (#11849) completed in 0.010951 seconds. 
2025-03-31 19:15:13.046267 - DEBUG --> GFCommon::is_spam_entry(): Executing functions hooked to gform_entry_is_spam. 
2025-03-31 19:15:13.046473 - DEBUG --> GFCommon::is_spam_entry(): Result from gform_entry_is_spam filter: false 
2025-03-31 19:15:13.046642 - DEBUG --> GFCommon::is_spam_entry(): Spam checks completed in 0.000555 seconds. Is submission considered spam? No. 
2025-03-31 19:15:13.046821 - DEBUG --> GFFormDisplay::handle_submission(): Executing functions hooked to gform_entry_created. 
2025-03-31 19:15:13.047061 - DEBUG --> GFFormDisplay::handle_submission(): Completed gform_entry_created. 
2025-03-31 19:15:13.047236 - DEBUG --> GFFormDisplay::handle_submission(): Executing functions hooked to gform_entry_post_save. 
2025-03-31 19:15:13.085171 - DEBUG --> GFFormDisplay::handle_submission(): Completed gform_entry_post_save. 
2025-03-31 19:15:13.085365 - DEBUG --> GF_Background_Process::dispatch(): Running for gf_feed_processor. 
2025-03-31 19:15:13.085937 - DEBUG --> GF_Background_Process::dispatch(): Unable to dispatch tasks to Admin Ajax: Nothing left to process 
2025-03-31 19:15:13.086143 - DEBUG --> GFFormsModel::create_post(): Starting. 
2025-03-31 19:15:13.088875 - DEBUG --> GFFormsModel::create_post(): Stopping. The form doesn't have any post fields. 
2025-03-31 19:15:13.089072 - DEBUG --> GFAPI::send_notifications(): Gathering notifications for form_submission event for entry #11849. 
2025-03-31 19:15:13.089379 - DEBUG --> GFCommon::send_notifications(): Processing notifications for form_submission event for entry #11849: Array
(
    [0] => 6717c9d768b82
)

(only active/applicable notifications are sent) 
2025-03-31 19:15:13.089553 - DEBUG --> GFCommon::send_notifications(): Notification is inactive, not processing notification (#6717c9d768b82 - Administratörsnotifikation) for entry #11849. 
2025-03-31 19:15:13.089720 - DEBUG --> GFCommon::send_notifications(): Sending notifications for entry (#11849) completed in 0.000345 seconds. 
2025-03-31 19:15:13.887142 - DEBUG --> GFFormDisplay::handle_confirmation(): Preparing confirmation (#6717c9d768f1c - Standardbekräftelse). 
2025-03-31 19:15:13.893273 - DEBUG --> GFFormDisplay::handle_confirmation(): Executing functions hooked to gform_confirmation. 
2025-03-31 19:15:23.037116 - DEBUG --> GFFormDisplay::handle_confirmation(): Completed gform_confirmation. 
2025-03-31 19:15:23.039606 - DEBUG --> GFFormDisplay::handle_confirmation(): Confirmation to be used => <script type="text/javascript">
function gformRedirect(){document.location.href="http:\/\/localhost:8888\/wpsamfek\/mina-sidor\/";}
</script>
 
2025-03-31 19:15:23.041268 - DEBUG --> GFFormDisplay::process_form(): Executing functions hooked to gform_after_submission. 
2025-03-31 19:15:23.051975 - DEBUG --> GFFormDisplay::process_form(): Completed gform_after_submission. 
2025-03-31 19:15:23.053550 - DEBUG --> GFFormDisplay::process_form(): Executing functions hooked to gform_post_process. 
2025-03-31 19:15:23.054634 - DEBUG --> GFFormDisplay::process_form(): Completed gform_post_process. 
2025-03-31 19:15:23.055234 - DEBUG --> GFFormDisplay::process_form(): Processing completed in 14.333288 seconds. 
2025-03-31 19:15:23.073096 - DEBUG --> Gravity_Forms\Gravity_Forms\Duplicate_Submissions\GF_Duplicate_Submissions_Handler::is_valid_submission(): form #41. entry #11849.