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.
Is is possible to reset the votes cast?
That is, I would like to be able to reset the number of votes on a particular node.
Any help with this would be much appreciated.
Cheers in advance.
Comment | File | Size | Author |
---|---|---|---|
#4 | plus1_reset.zip | 13.33 KB | Agileware |
#3 | plus1-703182-3.patch | 4.48 KB | Agileware |
Comments
Comment #1
Agileware CreditAttribution: Agileware commentedAfter a quick look at the code, the only time votes are deleted is when the node is deleted.
To reset all votes for a particular node you would have to add that feature.
You could put an option on the settings page where you could enter a node id and
click a button to reset it's votes.
You could also put an option on the node itself to do that.
Comment #2
Agileware CreditAttribution: Agileware commentedIt would be a fairly straightforward thing to implement.
Comment #3
Agileware CreditAttribution: Agileware commentedHere is a patch that adds this feature.
The patch:
* Adds an option on the plus1 settings page to enable the reset button on node edit pages. (admin/settings/plus1)
* Adds a user permission for "reset plus1 votes" (admin/user/permissions)
* If users have permissions and the setting is enabled the button will appear on the node edit form
Development for this patch was paid for by field4000
Comment #4
Agileware CreditAttribution: Agileware commentedHere is a copy of plus1-6.x-2.6 with the patch already applied.
Comment #5
abowers CreditAttribution: abowers commentedHi, I just installed the patch, and I'm noticing that the Reset Votes button shows up on all node edit pages, regardless of whether or not voting is allowed on them. I'm also noticing that it can be used to reset votes for Fivestar - maybe this is a separate module on its own? I'm in preliminary testing, but so far, so good! This patch covers exactly a client requirement!
Comment #6
jgreep CreditAttribution: jgreep commentedSubscribing
Comment #7
NancyDruThis will reset all votes on the node, regardless of the module that registered the vote. I suspect that unless P1 uses a different votingapi tag, there is not going to be a good solution. See VotingAPI: Data storage overview.
Comment #8
NancyDruSee also #788288: Delete user, delete vote.