Ajax problem in anpress-site.min.js – troubleshooting suggestions?

5.00K viewsIssues
0

Ajax doesn’t work when I try to ask/answer questions from most/all (?) Subscriber accounts.

For example, when I click ‘Post answer’ as an Administrator, I get the ‘Answer submitted successfully’ confirmation. When I do the same as a Subscriber, nothing happens – but the answer is still posted, so you’ll get lots of double/triple posts.

Ajax works fine for the main Administrator. Upgrading a Subscriber to Administrator doesn’t fix the problem, so I don’t think it is necessarily roles related.

I don’t know how to troubleshoot this. Any ideas very welcome.

Browser console says [object error] … invalid cha … “SyntaxError” … anpress-site.min.js (1,2787) … function __defineGetter__() … function __defineSetter__() … description “Invalid Character” … number -2146827274 …

I could provide a browser console screenshot or more details; I don’t know what it all means, what to look for.

I get the exact same anpress-site.min.js SyntaxError on a third clean install with the GitHub development version of AnsPress.

0

This mean there are some strings in ajax response which makes ajax response invalid JSON. This usually happens when php debug message output along with ajax.

In next update we are going to disable all PHP debug message in Ajax.

Thank you for your response. I have updated the plugin with the latest version, but still see the same problem. Has PHP debug been disabled? Can I do it myself in the code somewhere? Other suggestions how to troubleshoot this?

In new version it doesn’t matter if server send a PHP debug message. Thing will works as expected. This error should not happen in new version, I think you have partially updated AnsPress? Share a sample credential for your site so that I can check. send it to [email protected]