I'm working on a system using vote up down that needs to only react to a vote changing. The voteapi hooks: hook_votingapi_insert($vote) and hook_votingapi_delete($vote) are insufficient because you don't have all the information in either hook. (voteapi used to have a hook_votingapi_update but that seems to no longer exist).

To accomplish this I changed the vote_up_down_vote function to detect a change of an existing vote and call hook_vote_up_down_change($oldvote, $newvote).

CommentFileSizeAuthor
vote_up_down.patch647 bytespetermallett

Comments

marvil07’s picture

Version: 6.x-1.0-beta6 » 6.x-2.x-dev
Status: Active » Needs review

sorry, I think there will be no more new features for 1.x, moving to 2.x and changing status accordingly

marvil07’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Needs review » Needs work

After reading a related issue on the votingapi issue queue: #311657: Important: hook_votingapi_update needed for Drigg and User Karma!, I think we can implement this new hook if it do not affect performance too much.

Starting the review, I see it only include an extra call to a votingapi function, and I following it, I see many php functions called by it and only one sql query.

moving to 3.x to test it enough before commit, BTW I just committed a new hook_vud.php file(#833030: Document hooks) that need to be updated too.

marvil07’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Needs work » Postponed

No more feature requests for 6.x-3.x now that it is the stable branch, moving to 7.x-1.x as postponed until basic port is ready.

marvil07’s picture

Issue summary: View changes
Status: Postponed » Active