• Resolved justsomeone

    (@justsomeone)


    Dear Forminator Team,

    with your latest update the “Redirect on submit” feature is broken on a page.

    I have a hidden input field ({hidden-1}) which has the “embed url” as content.

    On submit the form does a “redirect on submit” to {hidden-1}.

    However on submit nothing happens. In the browser console I can see an “invalid url” issue.

    Could you please look into this? I temporarily rolled back to the previous version now.

    Best
    Robert

    • This topic was modified 2 years, 8 months ago by justsomeone. Reason: Change title to add version number
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter justsomeone

    (@justsomeone)

    I digged a little bit into the code.

    This is how the hidden field looks like in the rendered html on the frontend:

    
    <input type="hidden" id="hidden-1" name="hidden-1" value="https://www.some-example-page.com/contact-form">
    

    The error is thrown in front.multi.min.js:13214

    
    //same tab redirection
    window.location.href = self.decodeHtmlEntity(data.data.url);
    

    Where data.data.url looks like:

    
    url: "https://https%3A%2F%2Fwww.some-sample-page.de%2contact-form%2"
    

    So it seems that somewhere an additional https:// is added which leads to a malformed URL.

    • This reply was modified 2 years, 8 months ago by justsomeone.
    • This reply was modified 2 years, 8 months ago by justsomeone.
    • This reply was modified 2 years, 8 months ago by justsomeone.
    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @justsomeone

    I hope you’re well today and thank you for reporting this!

    You are right and there is an unexpected bug in recent release that’s breaking such redirects. Our Forminator Team is already aware of it and are working on a fix.

    I believe it will be fixed soon but I don’t have ETA yet (as it’s a “fresh discovery”).

    Downgrade to the previous version of the plugin would be a workaround for now until the fix is released.

    Kind regards,
    Adam

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @justsomeone

    I just came to know that we do have a workaround that could be used for now. It’s a bit of custom code that you can add to the site:

    1. create an empty file with a .php extensions (e.g. “forminator-redirect-fix.php”)
    2. copy and paste following code into it:

    <?php 
    
    add_filter( 'forminator_form_submit_response', 'wpmudev_fix_redirection_submission', 20, 2 );
    add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_fix_redirection_submission', 20, 2 );
    
    function wpmudev_fix_redirection_submission( $response, $form_id ){
    	if( $form_id != 361 ){ //Please change the form ID
    		return $response;
    	}
    
    	if( $response['behav'] == 'behaviour-redirect' ){
    		$response['url'] = preg_replace("(^https?://)", "", $response['url'] );
    		$response['url'] = rawurldecode($response['url']);
    	}
    
    	return $response;
    }

    3. in this line

    if( $form_id != 361 ){

    replace the 361 number with an ID of your form; the ID is the number which you can see in form’s shortcode

    4. save the file and upload it to the “/wp-content/mu-plugins” folder of your site’s WordPress installation using FTP, cPanel “File Manager” or similar way.

    It should work out of the box.

    Kind regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @justsomeone ,

    We haven’t heard from you for a while now, so it looks like you don’t need our assistance anymore.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Thread Starter justsomeone

    (@justsomeone)

    Hi @wpmudev-support2 , @wpmudev-support8

    the issue still exists in the latest 1.18.2 version.

    I don’t want to apply a workaround. Could you please fix the issue?

    Best
    Robert

    Plugin Support Jair – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @justsomeone,

    Mentioned bug is in the backlog of our Forminator team and it will be fixed on the upcoming versions. We are providing workarounds to our users to resolve their issues until the fix is being released since we don’t have any ETA for it.
    Thank you for your understanding.

    Kind regards,
    Zafer

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘1.17.1: Regression with redirect on submit’ is closed to new replies.