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.

CommentFileSizeAuthor
#4 plus1_reset.zip13.33 KBAgileware
#3 plus1-703182-3.patch4.48 KBAgileware
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Agileware’s picture

Category: support » feature

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

Agileware’s picture

It would be a fairly straightforward thing to implement.

Agileware’s picture

Status: Active » Needs review
FileSize
4.48 KB

Here 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

Agileware’s picture

FileSize
13.33 KB

Here is a copy of plus1-6.x-2.6 with the patch already applied.

abowers’s picture

Hi, 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!

jgreep’s picture

Subscribing

NancyDru’s picture

Status: Needs review » Needs work

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

NancyDru’s picture