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

CommentFileSizeAuthor
#2 piv_delete_issue.patch1.08 KBhunmonk

Comments

hunmonk’s picture

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

hunmonk’s picture

Assigned: Unassigned » hunmonk
Status: Active » Needs review
StatusFileSize
new1.08 KB

attached should fix the problem. AFAICT, i leveraged the votingapi functions as best i could to get what we needed here.

hunmonk’s picture

Status: Needs review » Fixed

committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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