The users old votes are not deleted when not explicitly setting $criteria (2nd argument) for votingapi_set_votes(). The docblock says: "If no value is specified, all votes for the current content by the current user will be reset."

Problem is that the value for the vote is added to the criteria. So only votes with the same user, same node and same value are deleted. Patch attached fixed this problem.

CommentFileSizeAuthor
votingapi_delete_votes.patch434 bytesmauritsl
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eaton’s picture

Status: Needs review » Fixed

Committed to dev, it will be part of the 7.x-2.4 release. Thanks!

Status: Fixed » Closed (fixed)

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

Robin van Emden’s picture

It seems the same problem can be found in 6.x-2.x-dev?