Closed (fixed)
Project:
Voting API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2007 at 11:49 UTC
Updated:
8 Oct 2012 at 12:11 UTC
When a node is deleted, should votingapi delete the stored votes and vote cache for that node (I think this might be best), or should each module that handles voting be responsible for this?
Comments
Comment #1
nancydruIMHO, this should be the responsibility of VotingApi.
Comment #2
nancydruComment #3
YK85 commentedsubscribing
Comment #4
seandunaway commentedCheck out project VotingAPI_Autoremove http://drupal.org/project/votingapi_autoremove
Comment #5
quotesbro commentedAt least there should be a link to http://drupal.org/project/votingapi_autoremove on the Voting API 'page.
I didn't even know about this missing implementation of hook_nodeapi() in votingapi until this moment, so my database has over 100,000 orphaned vote_ids and over 50,000 orphaned vote_cache_ids.
Comment #6
seandunaway commenteddberror, did votingapi_autoremove handle them all properly? I haven't had much testing or feedback from others on the module. Thanks.
Comment #7
quotesbro commentedYes, it did. Thank you for this module
Comment #8
rogical commentedThat modules only support node, user, I still think this should be in API module.
Comment #9
leschekfm commentedI also think this should be integrated with votingapi. If the maintainer agrees I will try to make a patch that would support all entities.
Comment #10
torotil commentedI agree, housekeeping with the votingapi_vote and votingapi_cache tables should be part of this module. Looking forward to your patch!
Comment #11
torotil commentedI've just pushed an implementation of this to the votingapi-7.x-2.x branch. It also cleans up orphaned votes and cache entries for deleted nodes and comments. It reacts to all entity deletions.
Thanks rump for writing the module and thus pointing me in the right direction.