It doesn't because vote results are kept in two tables:
- votingapi_cache
- votingapi_vote

"decisions_reset_form_submit()" function deletes only from on table - votingapi_vote.

I propose to add this line:
db_query("DELETE FROM {votingapi_cache} WHERE content_id = %d", $nid);

-------------

Additionally - after "Reset votes" option is used - users still can see "Cancel your vote" button (instead of been able to vote again). This button is not functional.
Users can't vote.

Somebody please verify my findings and conclusion.

CommentFileSizeAuthor
#5 969178-clear-cached-votes-5.patch802 bytescafuego

Comments

soma115’s picture

I think that "Cancel your vote" button will disappear (and user will be able to vote) if corresponding record in "cache_decisions" table will be deleted.
Which function deletes records from "cache_decisions" bounded to given node?

P.S.
If you ask me - this option shouldn't exist at all.

travisjbennett’s picture

I implemented this change on my site. Any idea when it might make a release? I think it is a handy admin feature, especially for testing, with these other issues to work out.
(Follow)

anarcat’s picture

Your patch would be welcome here.

(BTW, you do not need to comment issues to follow, just use the big green button on top. Thanks.)

jimethn’s picture

Thanks all, the information here allowed me to fix my problem as well. In addition to soma115's suggestion, I also added the code

db_query("DELETE FROM {cache_decisions} WHERE cid like 'decisions-%d-%%'", $nid);

so that resetting the votes allows users to vote again.

cafuego’s picture

Assigned: soma115 » Unassigned
Status: Active » Needs review
StatusFileSize
new802 bytes

Patch attached, please test :-)