Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @rizabahasuan,

    I’m afraid, I’m not sure whether I fully understand the issue noticed. I could notice the mentioned snippet should work fine in keeping the %0A in the URL.

    Could we know what exactly you notice as the output after the redirection where it’s breaking so that we could have a better idea?

    Also, could you please share the export to check the settings further? Please check the following doc on how to export a form:
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    You can share the export file via Google Drive, Dropbox or any such cloud services in the next reply.

    Looking forward to your response.

    Kind Regards,
    Nithin

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @rizabahasuan ,

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

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Hi, now this problem also happen. to me… new line disappear in url, any solution for this?

    it’s make %0A disapear from url

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @masmoek,

    I hope you are doing well today!

    Please confirm that you have used the mentioned code snippet in our response before as mu-plugin and still having the issue.

    If so, then please share an export of the form with us, so that we can check further.

    You can find more info on how to export the form here : https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    After exporting, please share the code using a service such as https://pastebin.com which is free to use.

    Please always make sure to use such service to share the code and don’t post the code here directly as it will most likely be unusable.

    Kind regards,
    Zafer

    Thread Starter Riza Bahasuan

    (@rizabahasuan)

    Hi @wpmudevsupport15

    I would like to follow up the issue I have.

    Please access the code of the form,
    https://drive.google.com/file/d/15lct-xUmPigpvRI0kiT-HzmGg8mR3eE3/view?usp=sharing

    If you to submit the form, it will redirecting to WhastApp,
    the pretext I want is:

    Name: {name-1}
    Email: {email-1}
    Message: {message-1}

    but the result is like this:
    Name: {name-1}Email: {email-1}Message: {message-1}

    Thank you,
    Riza

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @rizabahasuan,

    I could notice anomalies when tested, the encoding isn’t getting passed to the URL on redirect.

    I’m escalating this further to our developer’s attention to see what is causing the behaviour.

    Will keep you posted once we get further feedback.

    Kind Regards,
    Nithin

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @rizabahasuan

    Please use the following snippet in a MU plugin (https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins):

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

    The form ID should be changed from 3455 to your form ID (the same integer number also found in the form’s shortcode).

    Thank you,
    Dimitris

    Thread Starter Riza Bahasuan

    (@rizabahasuan)

    Hello @wpmudev-support6

    Thank you for your assistance.

    I added the code in the MU Plugin and changed the form ID but not working.

    Only %0A is missing in the URL.

    Thank you
    Riza

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @rizabahasuan

    I hope you are doing well,

    I pinged our developer to verify this again for you, I could replicate the missing %0A

    Best Regards
    Patrick Freitas

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @rizabahasuan,

    Please try the following new snippet and see how that goes:

    <?php
    
    add_filter( 'forminator_form_submit_response', 'wpmudev_add_line_break_to_response', 20, 2 );
    add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_add_line_break_to_response', 20, 2 );
    
    function wpmudev_add_line_break_to_response( $response, $form_id ){
    	if( $form_id != 3459 ){ //Please change the form ID
    		return $response;
    	}
    
    	if( $response['behav'] == 'behaviour-redirect' ){
    		if ( strpos( $response['url'], 'line_br' ) !== false ) {
    			$response['url'] = str_replace( 'line_br', '%0A', $response['url'] );
    		}
    	}
    	
    	return $response;
    }

    Suppose your form ID is 123, then you’ll need to update the above line ie:

    	if( $form_id != 3459 ){ //Please change the form ID
    

    To:

    	if( $form_id != 123 ){ //Please change the form ID
    

    You’ll need to use {line_br} macro instead of %0A directly in the redirect URL.

    That’s for example:
    https://wa.me/{phone-1}/?text=Name:{name-1}{line_br}Email:{email-1}{line_br}Phone Address {phone-1}

    You can implement the above code as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    I gave a quick test and could notice now it’s passing the “%0A” correctly in the URL.

    However, even without the code, if I manually try to add %0A directly in the WhatsApp URL, it doesn’t seem to create a new line which is more specific to Whatsapp.

    Kind Regards,
    Nithin

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @rizabahasuan ,

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

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

    Hi, @wpmudevsupport11

    I am facing the same issue on the form submission which is the %0A missing after got through the first whatsapp link even after implemented the code from the previous replied as a mu-plugins.
    Please advice. Thanks.

    • This reply was modified 1 year, 11 months ago by a1extan.

    I have solved it by adding html field and hide it behind the form.
    Use it during submission and it will show up in the url.
    Hope this can help others.
    Anyway thanks.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Forminator Redirect URL Encode (New Line) Missing’ is closed to new replies.