Invalid request. Please try again.

Support MB Frontend Submission Invalid request. Please try again.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #48792
    EddyPiVEddyPiV
    Participant

    I keep on getting the mmessage 'Invalid request. Please try again.'

    This is the code I'm using:

    [mb_frontend_form id='paying-member-input-details' object_id='{{ post.ID }}' post_fields='' ajax='true' submit_button='Save']
    

    Any idea what may be causing this?

    #48798
    PeterPeter
    Moderator

    Hello Eddy,

    Thanks for reaching out.

    I don't see any issues with the frontend form shortcode. Do you use any custom code that affects the mbfs_key of the form? Please try to deactivate all plugins except Meta Box plugins, switch to a WordPress theme and recheck the form submission.

    #48805
    EddyPiVEddyPiV
    Participant

    I made a fresh copy in staging, and there it's working nicely.
    I'm checking with the support team of my hosting provider. Hoepfully they can help solve it, or at least help understanding what / where to investigate. I may get back here.

    #48813
    EddyPiVEddyPiV
    Participant

    Hi,

    I got a response from the support unit of my hosting provider.

    After further investigation, I found that the issue is with the Metabox plugin, which is not compatible with the Object Caching feature. This explains why it functions correctly on the staging site, where Object Caching is not active.
    Please note that disabling Object Cache is not recommended, as it can significantly impact server performance. I suggest reaching out to the developers of the Metabox plugin to inform them of this issue, as it seems their plugin is not designed to be compatible with the server’s Object Caching.

    Can you pls have this checked and see if this can be resolved?
    Thanks a lot, regards,
    Eddy

    #48814
    PeterPeter
    Moderator

    Hello Eddy,

    Thanks for the details.

    Can you please ask them to share more details about the compatibility with Object Cache? I will also inform the development team to research this and let you know if I have more information.

    #48815
    EddyPiVEddyPiV
    Participant

    Peter, my sites are hosted at WPMUDev, they have documentation about it here: https://wpmudev.com/docs/hosting/tools-features/#object-cache

    Do you want me to check with them for a way that your development team can discuss this further with them?
    As I don't think that me staying in the middle will be very practical.
    Let me know.

    #48820
    PeterPeter
    Moderator

    Hello,

    I've forwarded this ticket to the development team to check the issue with Object Cache. I will let you know if I have more information.

    Thank you.

    #49003
    EddyPiVEddyPiV
    Participant

    Hi Peter, is there any news on this from the development team?

    Regards,
    Eddy

    #49012
    PeterPeter
    Moderator

    Hello,

    Our development team has checked the issue and didn't find the compatibility issue with Object Cache. Technically, we are using the transient to save the form key mbfs_key as I mentioned above. And the transient will be saved to the Object Cache by WordPress.
    The issue happens when you submit the form, is somehow the function in the background doesn't get the form key from the transient. See these screenshots https://imgur.com/a/vXbKafy

    I've tested again with Redis Object Cache and not see the same issue. I think you can share this info with the WPML support and see if they can help you monitor the transient value on your site.

    #49026
    EddyPiVEddyPiV
    Participant

    You're right.
    As the frontend submission form is loaded within a popup window and I have only the memberid (which is the page title) a used a get_posts with just 1 post.
    I've changed it: upon clicking the pencil icon I store the post-id in a user meta field which I read in the View (from where the frontend submission is called).
    Now it saves properly.

    Now just another question arises: I've set the redirect url, but it doesn't reload the entire page. Ajax=false.
    How can I reload the entire page, so that the saved changes become visible right after?

    #49028
    PeterPeter
    Moderator

    Hello Eddy,

    If you are using some custom code to show the frontend form in a popup window, the PHP redirect function won't work properly. So you can use the JavaScript code to reload the page. For example:

    window.location.reload();

    #49058
    EddyPiVEddyPiV
    Participant

    I would expect that the action rwmb_frontend_after_save_post should be used, but it's not firing.

    This is my reload-after-save-metabox.js:

    jQuery(document).ready(function($) {
        // This fires when MB Frontend Form finishes saving
        $(document).on('mb_frontend_after_save', function(e, data) {
            console.log("✅ MB form saved, reloading now...", data);
            window.location.reload();
        });
    });

    I'm a real beginner with JavaScript. Can you point me in the right direction?

    #49059
    EddyPiVEddyPiV
    Participant

    Typo, but result is the same...

    jQuery(document).ready(function($) {
        // This fires when MB Frontend Form finishes saving
        $(document).on('rwmb_frontend_after_save', function(e, data) {
            console.log("✅ MB form saved, reloading now...", data);
            window.location.reload();
        });
    });
    #49065
    PeterPeter
    Moderator

    Hello,

    There isn't a JavaScript event name rwmb_frontend_after_save like that. If you want to use the WordPress hook with PHP code, you can use the hook rwmb_frontend_after_save_post
    Following the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#post-actions

    If you are not familiar with JS code, we offer a customization service with an extra fee. Please contact us here to get more details https://metabox.io/contact/

    #49066
    EddyPiVEddyPiV
    Participant

    Peter, I don't want to use the wordpress hook.
    I follow your recommendation to use the JavaScript code to reload the page. What I want to know is the trigger that should fire the Javascript. If it's not this hook, then what is it?
    How can I reload the full page after successful safe?

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.