Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
votingapi_delete_votes.patch | 434 bytes | mauritsl | |
Comments
Comment #1
eaton CreditAttribution: eaton commentedCommitted to dev, it will be part of the 7.x-2.4 release. Thanks!
Comment #3
Robin van Emden CreditAttribution: Robin van Emden commentedIt seems the same problem can be found in 6.x-2.x-dev?