Submit button on message page rest_forbidden


Home Forums Front End PM PRO Submit button on message page rest_forbidden

This topic is: Not Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43901
    lia.spoerl
    Participant

    Hi,

    I have a ajax button located after the reply message.

    When I send a message and then click this button I get the below error:
    {“code”:”rest_forbidden”,”message”:”Sorry, you are not allowed to do that.”,”data”:{“status”:401}}

    If I don’t send a message and click the button I get no error.

    Is there a way to prevent this?

    Thanks

    #43904
    lia.spoerl
    Participant

    I also get redirect to this url which is where the above message shows: /wp-json/front-end-pm/v1/view-message/267

    #43921
    lia.spoerl
    Participant

    For now I enabled the below.

    I wonder, Is there a better solution to this though?

    add_filter( ‘fep_form_submit_button’, function( $button, $where ){
    if( ‘reply’ == $where ){
    // $fep_message_id = fep_get_the_id();
    // $website = site_url( ‘/messages/’, ‘https’ ) . ‘?fepaction=viewmessage&fep_id=’ . fep_get_parent_id($fep_message_id);
    $button = ‘<button type=”submit” onclick=”setTimeout(location.reload.bind(location), 1500);” class=”fep-button” name=”fep_action” value=”‘. esc_attr( $where ) .'”>Reply</button>’;
    }
    return $button;
    }, 10, 2 );

    Thanks

    #43938
    Shamim Hasan
    Keymaster

    Do you have any staging website? Can you deactivate all plugins and activate default theme then try again? Then activate one by one and check when this issue re-appears?

Viewing 4 posts - 1 through 4 (of 4 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.