When a bug (node) is deleted, all votes associated with that bug need to be returned to the open pool, and not charged against a voter.
I did this:
- Created a project
- Created an issue
- Put 3 votes on the issue
- Deleted the issue
When I'm creating a new issue, the preview shows that I have 3 of N total votes used
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | piv_delete_issue.patch | 1.08 KB | hunmonk |
Comments
Comment #1
hunmonk commentedi was assuming this was votingapi's job, but:
hunmonk:eaton: i'm curious, is votingapi supposed to have support for handling deleted content?
hunmonk:eaton: ie, if a note w/ votes on it is deleted, do you consider it votingapi's job to handle removing the votes?
eaton:hunmonk: not natively, no. mostly because it does not, inherently, implement any content related hooks.
hunmonk:eaton: ok, i guess that means it's the module leveraging votingapi that the responsibility falls on
eaton:i.e., votingapi doesn't look for node or comment related events at all. Technically it's up to impelemnting modules to delete if they insert, though I don't think it's ever explicitly mentioned
so i guess we'll need to add support for this.
Comment #2
hunmonk commentedattached should fix the problem. AFAICT, i leveraged the votingapi functions as best i could to get what we needed here.
Comment #3
hunmonk commentedcommitted to HEAD.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.