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

nancydru’s picture

IMHO, this should be the responsibility of VotingApi.

nancydru’s picture

Component: Miscellaneous » Code
Category: bug » feature
YK85’s picture

subscribing

seandunaway’s picture

Check out project VotingAPI_Autoremove http://drupal.org/project/votingapi_autoremove

quotesbro’s picture

Priority: Normal » Major

At 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.

seandunaway’s picture

dberror, did votingapi_autoremove handle them all properly? I haven't had much testing or feedback from others on the module. Thanks.

quotesbro’s picture

Yes, it did. Thank you for this module

rogical’s picture

That modules only support node, user, I still think this should be in API module.

leschekfm’s picture

Version: master » 7.x-2.x-dev

I also think this should be integrated with votingapi. If the maintainer agrees I will try to make a patch that would support all entities.

torotil’s picture

I agree, housekeeping with the votingapi_vote and votingapi_cache tables should be part of this module. Looking forward to your patch!

torotil’s picture

Status: Active » Fixed

I'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.

Status: Fixed » Closed (fixed)

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