AnsPress 2.0 – Ask Question page not working properly anymore.

6.03K viewsCore
0

After updating to commit 484932e05586180940ac7c7b9c0071ad1c548d83, the Ask Question page does not work properly anymore.
Well, you can still post questions, but after successfully posting a question, the page does not redirect anymore.
And when for example a required field is not filled, the error is not shown anymore.
The backend (php) still seems to work, I get the correct responses (HTTP 200 + json):

{"form":"ask_form","message_type":"error","message":"Check missing fields and then re-submit.","errors":{"title":"This field is required","description":"This field is required","tag":"This field is required"},"ap_responce":true,"is_ap_ajax":true}

but then I get

 Uncaught TypeError: Cannot read property 'setContent' of null             anspress_site.js?ver=1.4.3:169

Is this version 1.4.3 accurate?

0

Hi Rahul, can you please un-mark as solved?
Sorry for using an answer instead of a comment, but I need some markup…

I found out why it was only working in Chrome and not in FF and IE:
I was logged in as admin in Chrome, as subscribers in FF and IE.
Problem: the posting only works when logged in as admin, not if logged in as non-admin.

When logged in as admin, if you post a question without specifying all fields you get a HTTP-200 response on the POST

/wp-admin/admin-ajax.php  |  POST  | 200 OK  |  application/json   jquery.js?ver=1.11.1:4 Script

I get the “Field Required” messages.
The Tags lookup works.
When I fill all fields, the question gets posted correctly and I am sent to the questions detail page (with answer box).
When logged in as a subsciber, I get a HTTP-302 followed by a HTTP-200:

/wp-admin/admin-ajax.php  |  POST  |  302 Found | application/json   jquery.js?ver=1.11.1:4 Script
localhost                 |  GET   |  200 OK    | text/html          http://localhost:8080/wp-admin/admin-ajax.php Redirect

I get no “Field Required” messages.
The Tags lookup does not work, so I cannot create a completely filled and valid question.

I will check, make sure to hard refresh browser

I did hard refresh & clear cache.
It’s not the same issue as original reported in this post. There are no errors in the console, just this strange behavior.

Can you please leave a comment if you were able to reproduce?

0

Issue fixed please check once

Hi Rahul,

It is working in Chrome but I can’t get it to work in FF and IE… even after clearing the caches… weird. Will check this again.

!! => One other thing I noticed is that, if you enter a title and a description but forget to add a tag and then submit, you get a warning message that you need to specify a tag. This is correct of course, but the description field is wiped. Can you please have a look at this?

Checked and working fine. Thanks.