Custom Fields
Re-Envisioned
Support MB Frontend Submission Submission from non-logged in users failing,

  • Creator
    Topic
  • #21942
    Resolved davidrknowles
    Participant

    Hi guys, its been a while.

    Just trying to sort out a few issues I have been having of recent.

    I noticed that non-logged on users were not able to submit a form anymore.

    I have a metabox with 4 fields including email.
    The form is sent to a CPT non of the standard PT fields are used, but Title is checked in the post type settings as I have a action (rwmb_frontend_after_process) modifying the post using wp_update_post.

    This was working fine in the past but recently it seems to fail, if I use the AJAX method I get a return error TypeError: Cannot read property 'message' of undefinedprobably due to the return variable.

    The wp logs are not showing anything apart form PHP Warning: chmod(): Operation not permitted in /....../class-wp-filesystem-direct.php on line 173

    Not to sure where the problem is, as it works fine for logged on users.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #21945
    davidrknowles
    Participant

    Ignore the PHP Warning: chmod() warning, it was just a server permission error, was hoping it would fix the form submission issue but to no avail.

    I have tried removing the action rwmb_frontend_after_process and also editing the post type settings, and removing reCaptcha and AJAX. without AJAX I get a 404 returned.

    #21946
    Long Nguyen
    Moderator

    Hi David,

    Please deactivate all plugins except Meta Box, Meta Box extensions, and switch to the default theme of WordPress (Twenty Twenty) then submitting post again with two case: no Ajax and Ajax.

    Let me know how it goes.

    #21951
    davidrknowles
    Participant

    Hi Long,

    I tried all of what you have suggested and it is as follows.

    Everything off apart from meta box and meta box AIO:
    with ajax = Fail
    without ajax = Pass

    So I turned everything on again:
    with ajax = Fail
    without ajax = Pass

    I then tried with without ajax but added in reCaptcha = Fail

    So it looks like its to do with the validation of the ajax request or reCaptcha, maybe requiring some kind of user validation.

    Hope this helps

    #21952
    davidrknowles
    Participant

    Also worth adding without both ajax request or reCaptcha it still fails in a different browser like Brave or firefox, it just gives a 404.

    #21954
    Long Nguyen
    Moderator

    Hi,

    I’ve double-checked on my demo site but not see this issue, you can also check in URLs.
    http://metabox.nguyenthanhlong.info/frontend-submit/
    http://metabox.nguyenthanhlong.info/frontend-submit-noajax/

    #21963
    davidrknowles
    Participant

    Thats really weird both those links work fine.

    This is my form: https://davidrknowles.com/contact/

    #21968
    davidrknowles
    Participant

    I really dont understand why it’s not working, I have updated to PHP 7.4, I have reflushed the server permissions, restarted the server. Now its not submitting with all the plugins off and the default theme without being logged in.

    #21969
    davidrknowles
    Participant

    Ok I think I have sorted it, being away from WP for a while has made forget what a hassle caching can be, I turned off VARNISH in my server and it seems to be all work.

    The only weird thing now is the Title field is now showing regardless of not having it in the shortcode.

    #21970
    davidrknowles
    Participant

    Fixed that too lol turns out I was editing the shortcode in the WP Block and not the beaver builder module.

    Seems to be working perfectly now. thanks

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