Home › Forums › Backend Issues (wp-admin) › Backend validation prevents saving options › Reply To: Backend validation prevents saving options
I don’t know what the fix was, I think I saw a note about it in the changelog. I’m not a dev working on the site, just another user.
Debugging JS can be difficult and it get’s more complex if AJAX is involved.
When I’m working on straight JS I usually add a console.log(SOMETHING);
to see what values are. Same as using echo or print_r in PHP. Sometimes I throw in alert(SOMETHING);
for simple values.
When dealing with AJAX you have 2 things to contend with, the JS and the server side PHP code. It’s impossible to see what’s happening on the server side in the browser. When I’m dealing with the PHP side I use errro_log()
http://php.net/manual/en/function.error-log.php to write stuff to the error log.
Debugging someone else’s JS/AJAX can be infinitely more complex than debugging your own, especially when AJAX is involved. While I’m doing dev on my own stuff and I’m dealing with AJAX, I am usually returning JSON and I have a console.log(json);
so that I can see what’s being returned. Then I can simple do something like echo json_encode($_POST); exit;
on the PHP side to see what was submitted, or to see whatever I want to see from the server in the AJAX response. Tracking down where to do these things in someone else’s code can be done but it’s a lot more difficult.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.