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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 969178-clear-cached-votes-5.patch | 802 bytes | cafuego |
Comments
Comment #1
soma115 commentedI 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.
Comment #2
travisjbennett commentedI 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)
Comment #3
anarcat commentedYour patch would be welcome here.
(BTW, you do not need to comment issues to follow, just use the big green button on top. Thanks.)
Comment #4
jimethn commentedThanks 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.
Comment #5
cafuego commentedPatch attached, please test :-)