• Hello,

    I am using your plugin and have an issue after the version 3.15.3 of this plugin.

    In frontend, when i click on the submit button to save my form with the action set to “referer”, i am redirect to the root page of my website.

    In 3.15.3, the popin just close and every thing was save.

    I share to you the link to the video of my problem.

    How can i fix this ?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gerem

    (@gerem)

    I get something, i hope it can help you to fix.

    You change something in the file : acf-frontend-form-element/main/frontend/forms/classes/form-submit.php

    function get_redirect_url().

    in version 3.15.3 :

    public function get_redirect_url( $form ) {
    
    if ( ! empty( $form['return'] ) ) {
    
    return $form;
    
    }
    
    $redirect_url             = '';
    
    $form['message_location'] = 'other';
    
    switch ( $form['redirect'] ) {
    
    case 'custom_url':
    
    if ( is_array( $form['custom_url'] ) ) {
    
    $redirect_url = $form['custom_url']['url'];
    
    } else {
    
    $redirect_url = $form['custom_url'];
    
    }
    
    break;
    
    case 'current':
    
    global $wp;
    
    $redirect_url = $form['current_url'];
    
    // $form_args['reload_current'] = true;
    
    $form['message_location'] = 'current';
    
    break;
    
    case 'referer_url':
    
    $redirect_url = $form['referer_url'];
    
    break;
    
    case 'post_url':
    
    $redirect_url = '%post_url%';
    
    break;
    
    }
    
    }

    In your last version :

    public function get_redirect_url( $form ) {
    
    if ( ! empty( $form['return'] ) ) {
    
    return $form;
    
    }
    
    $redirect_url             = '';
    
    $form['message_location'] = 'other';
    
    switch ( $form['redirect'] ) {
    
    case 'custom_url':
    
    if ( is_array( $form['custom_url'] ) ) {
    
    $redirect_url = $form['custom_url']['url'];
    
    } else {
    
    $redirect_url = $form['custom_url'];
    
    }
    
    break;
    
    case 'referer_url':
    
    $redirect_url = $form['referer_url'];
    
    break;
    
    case 'post_url':
    
    $redirect_url = '%post_url%';
    
    break;
    
    default:
    
    global $wp;
    
    $redirect_url = $form['current_url'];
    
    // $form_args['reload_current'] = true;
    
    $form['message_location'] = 'current';
    
    }
    
    return $form;
    
    }

    When i choose the action “referer”, the variable $form[‘redirect’] equals “referer”.

    But in your switch, you don”t have the “referer” case, so with your modification, the option goes to default, and set the root url.

    Thread Starter gerem

    (@gerem)

    So below my fix : add a switch case :

    case "referer": break;

    below the full function :

    public function get_redirect_url( $form ) {
    
    if ( ! empty( $form['return'] ) ) {
    
    return $form;
    
    }
    
    $redirect_url             = '';
    
    $form['message_location'] = 'other';
    
    switch ( $form['redirect'] ) {
    
    case 'custom_url':
    
    if ( is_array( $form['custom_url'] ) ) {
    
    $redirect_url = $form['custom_url']['url'];
    
    } else {
    
    $redirect_url = $form['custom_url'];
    
    }
    
    break;
    
    case 'referer_url':
    
    $redirect_url = $form['referer_url'];
    
    break;
    
    case 'post_url':
    
    $redirect_url = '%post_url%';
    
    break;
    
    case ‘referer’:
    
    break;
    
    default:
    
    global $wp;
    
    $redirect_url = $form['current_url'];
    
    // $form_args['reload_current'] = true;
    
    $form['message_location'] = 'current';
    
    }
    
    return $form;
    
    }
    Thread Starter gerem

    (@gerem)

    Still not fix on your last update…

    Can you fix it ?

    I have to change the code everytime …

    Plugin Author Shabti Kaplan

    (@shabti)

    @gerem

    My apologies. We will push this in the next update

    Thread Starter gerem

    (@gerem)

    Hello,

    Still not working on your version 3.18.2

    Your are not implement my fix

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Submit Form Action “referer” not working after version 3.15.3’ is closed to new replies.