Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
529 views
in Plugins by

There is a bug in https://github.com/NoahY/q2a-poll/blob/master/qa-poll-layer.php

Line 298

$answers[$idx]['vote'] = '<div class="qa-poll-voted-button" title="'.qa_html(qa_lang('polls/voted_button')).'" onclick="pollVote('.$qid.',\''.$uid.'\',\''.$answer['id'].',1)"></div>';
 
 
in:
pollVote('.$qid.',\''.$uid.'\',\''.$answer['id'].',1)
 
Before answer there is an extra \' that makes poll not work when a user want to cancel his/her vote.

1 Answer

+2 votes
by

Thanks !

Now the "unvote" works.

As per your instructions I've changed line 298 from :

$answers[$idx]['vote'] = '<div class="qa-poll-voted-button" title="'.qa_html(qa_lang('polls/voted_button')).'" onclick="pollVote('.$qid.',\''.$uid.'\',\''.$answer['id'].',1)"></div>';

to :

$answers[$idx]['vote'] = '<div class="qa-poll-voted-button" title="'.qa_html(qa_lang('polls/voted_button')).'" onclick="pollVote('.$qid.',\''.$uid.'\','.$answer['id'].',1)"></div>';

...