Download & Extend

Clean up the voting results - not just the votes

Project:Plus 1
Version:6.x-2.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I recently removed a lot of nodes with a lot of votes form a test site and discovered that the calculated results from each one of the nodes was still left in the votingapi tables.

What I did was to duplicate the already existing functionality that removes the votes and made it remove the results as well - through votingapi_select_results and votingapi_delete_results.

AttachmentSize
plus1_clean_up_votingapi_results.patch540 bytes

Comments

#1

How do you know those votes came from P1? See #1010890: Change votingapi tag.

#2

Does it matter? If the node is gone then all of the results related to that node can be deleted - right?

#3

Right. Guess I got caught up in those other "unvote" requests. Now that I am corrected, shouldn't all of this be in the VotingApi module?

#4

I don't think the Voting API cares what it removes - and any way - the votes are already removed using the same criteria - but the results has been forgotten - which the patch fixes :)

#5

I agree that the results should cleaned up. My question is who should do it. #115322: Delete votes for deleted nodes

#6

Just speculating here (I should probably look at the code instead - but speculating is easier). The Voting API describes itself as an API for "[...] rating of any content (comments, nodes, users, fish, whatever)" - since we have no hook_fishapi() or hook_whateverapi() the Voting API module can't implement any removal of stuff itself - instead I think it has to delegate that to the modules integrating the Voting API with fish or nodes :)

#7

Status:needs review» patch (to be ported)

#8

Status:patch (to be ported)» fixed

Committed to 6.x-2.x-dev.

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here