Critical Error on submit redirect [RESOLVED]

I have a new form that redirects to a url. If I don’t have redirect on and just confirmation it works fine. I also have a gravit to salesforce plugin but even with it not sending to salesforce I get a critical error. PHP Is throwing some errors in the logs:

| 13 | Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in |
| | /nas/content/live/XXXs/wp-includes/formatting.php:449#012Stack trace:#012#0 |
| | /nas/content/live/XXXs/wp-includes/formatting.php(449): trim(Array)#012#1 |
| | /nas/content/live/XXXs/wp-content/themes/XXX/theme-functions.php(101): wpautop(Array)#012#2 |
| | /nas/content/live/XXXs/wp-includes/class-wp-hook.php(326): {closure}(Array)#012#3 |
| | /nas/content/live/XXXs/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)#012#4 |
| | /nas/content/live/XXXs/wp-content/plugins/gravityforms/gravityforms.php(7296): apply_filters(‘gform_confirmat…’, Array, Array, Array, |
| | false, NULL, NULL, NULL, NULL, NULL, NULL, NULL)#012#5 /nas/content/live/XXXs/wp-content/plugins/gravityforms/form_display.php(2162): |
| | gf_apply_filters(‘gform_confirmat…’, Array, Array, Array, false)#012#6 |
| | /nas/content/live/XXXs/wp-content/plugins/gravityforms/form_display.php(2027): GFFormDisplay::handle_confirmation(Array, Array, |
| | false)#012#7 /nas/content/live/XXXs/wp-content/plugins/gravityforms/form_display.php(201): GFFormDisplay::handle_submission(Array, Array, |
| | false)#012#8 /nas/content/live/XXXs/wp-content/plugins/gravityforms/gravityforms.php(886): GFFormDisplay::process_form(29, 1)#012#9 |
| | /nas/content/live/XXXs/wp-includes/class-wp-hook.php(324): GFForms::maybe_process_form(Object(WP))#012#10 |
| | /nas/content/live/XXXs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#012#11 |
| | /nas/content/live/XXXs/wp-includes/plugin.php(565): WP_Hook->do_action(Array)#012#12 |
| | /nas/content/live/XXXs/wp-includes/class-wp.php(830): do_action_ref_array(‘wp’, Array)#012#13 |
| | /nas/content/live/XXXs/wp-includes/functions.php(1336): WP->main(‘’)#012#14 /nas/content/live/XXXs/wp-blog-header.php(16): |
| | wp()#012#15 /nas/content/live/XXXs/index.php(17): require(‘/nas/content/li…’)#012#16 {main}#012 thrown in |
| | /nas/content/live/XXXs/wp-includes/formatting.php on line 449

I’m also getting some other errors in the logs: PHP Warning: Undefined array key “tags” in /nas/content/live/XXXX/wp-content/plugins/gravityforms/common.php on line 1515

any ideas?

The stack trace indicates the theme is using the gform_confirmation filter and has most likely passed the $confirmation array to the WordPress wpautop function. The theme developer will need to update their code so that doesn’t happen.

Thank you. I had this in the theme-functions and removed it:

add_filter(
	'gform_confirmation',
	static function ( $confirmation ) {
		return wpautop( $confirmation );
	}
);

I wonder why it was there?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.