Hi!

It is about review nodes I described here:
http://drupal.org/node/318610

If the node with CCK fivestar field is unpublished it is still cast a vote. I think it is not consistent because users do not see unpublished node but see its vote on the other node.

This patch fixes insert and update of unpublished nodes so they do not cast a vote until published. It works at least for registered users vote. It may not always work for anonymous because we do not have vote_id to revoke specific vote, as I suggest in topic above.

CommentFileSizeAuthor
fivestar_field_status.patch849 bytessin

Comments

sin’s picture

Status: Needs review » Needs work

I just realizd that my patch will not work because when the anonymous node will be published by admin the vote will be cast using admin's IP-address :( We can't just publish/unpublish anonymous votes until we got some vote moderation support in VotingAPI. Any ideas?

sin’s picture

A solution without touching VotingAPI... what if I store vote IP and timestamp in addition to rating and target columns in CCK content-type table? When I can safely delete the vote on review node unpublishing and cast it again on node publishing. This would also improve IP-based anonymous vote deletion.

This would require 2 new optional arguments in _fivestar_cast_vote() function: ip and timestamp. Is it a good solution?

quicksketch’s picture

A more reliable method would be storing the vote_id in the CCK content-type table, then there would be no doubt at all about which vote was associated with the CCK field. This is the approach used by fivestar_comment module to keep track of votes when comments are deleted.

sin’s picture

Thanks, quicksketch, I thought about it but do not found where VotingAPI returns vote_id, I'l check fivestar_comment module.

Timur5’s picture

Hey sin and quicksketch,
The patch indeed doesn't work for anonymous users who leave votes which require admin approval: the vote for unpublished comments is still displayed.

However, that looks like a bright idea!
The reason why users use admin approval measure is mainly to prevent spammers from casting meaningless votes.
So, if we could somehow at least eliminate the showing of unapproved votes, the problem will be solved - an admin will come and delete the spam vote while the page remains intact shiny and spam free :)

daneyuleb’s picture

Any updates on this? (Showing unpublished comment votes is pretty much a show stopper for the fivestar comment module on my site).

sin’s picture

Assigned: sin » Unassigned

No. I didn't worked on this issue anymore.

jsims281’s picture

I had a similar issue but using the fivestar comment module.

My workaround can be found here:
http://drupal.org/node/358614#comment-4421454

You would have to change some of the database queries to work with your site, but the basic idea might get you started?

ericduran’s picture

Version: 6.x-1.13 » 6.x-2.x-dev

Moving to the 2.x branch. Sorry is not feasible to maintain 3 different branches. I'l work on 2.x then anything that's been fixed there we can proposed to be back-ported to the 1.x branch.

Thanks.

whiteph’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

We can no longer support the Drupal 6 version of Fivestar. It is in security maintenance mode only. When the Drupal 8 version of Fivestar is released, the Drupal 6 version will be officially deprecated.

whiteph’s picture