Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
777 views
in Q2A Core by

I have built my own theme by overriding the theme-base. Whenever I click on Answer buttons, like 'hide','flag' etc, the ajax request fails. I figured out that it's because of unsuccessful return of qa_check_form_security_code();  My server error log says, "PHP Question2Answer form security violation for buttons-1133 by userid 1 (code mismatch)". And it works fine with default themes like 'Snow'. What might be the problem here? 

Thanks 

 

2 Answers

0 votes
by
Had the same problem with custom theme, there may be some problems with HTML markup (sended Anti-CSRF code in my case was from vote form)
0 votes
by

Check if you have set the hidden input field.

<input type="hidden" name="code" value="0-1396447326-etc">

The value is generated by q2a using:

<?php
   $this->output('<input type="hidden" name="code" value="'.qa_get_form_security_code('answer-'.$question['postid']).'">');
?>

You need to specify the correct item for qa_get_form_security_code(). Check all files in qa_include folder for this function to get an overview.

...