Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
i have a content type (review) to vote on one node. anonymous users can vote. i notice that if i delete one review node created by anonymous user, all votes by anonymous users are deleted from votingapi_vote table. i guess the sql statement uses "where nid=0" instead of "where nid=0 and hostname like 'xxxxx"
Is this a bug from fivestar or from voting_api module? I apologize if i did post it in a wrong place.
thanks.
Comment | File | Size | Author |
---|---|---|---|
#6 | fivestar_anonymous_check.patch | 1.45 KB | quicksketch |
Comments
Comment #1
quicksketchYou'll need to upgrade to the latest version of Fivestar to see if this is still a bug in the latest release. It should delete only that single anonymous vote, as per this query from Fivestar:
Comment #2
xqi CreditAttribution: xqi commentedquicksketch, thanks for the reply.
I am using the latest release of fivestar and votingapi.
i think the deletion happens in the following code when calling votingapi function votingapi_unset_vote. which really should pass the hostname as a parameter. it seems to me votingapi and fivestar need collaborate to have this bug fixed.
'. $item['target']);
}
if (is_numeric($items[$delta]['target'])) {
votingapi_unset_vote('node', $items[$delta]['target'], $node->uid);
}
}
?>
Comment #3
quicksketchThe code you pointed out is from the Fivestar CCK implementation, I was assuming you were using normal comments. Are you indeed using CCK for your reviews? That'd help me understand where this problem is located.
Comment #4
xqi CreditAttribution: xqi commentedyes, i use fivestar as a cck field in my node type "review".
Comment #5
xqi CreditAttribution: xqi commentedbump
Comment #6
quicksketchI finally got to looking at this problem, it's Drupal 5 specific as VotingAPI in Drupal 6 handles this logic for us. Fivestar was only adding the hostname to the queue when a $uid was not being passed in. However, in the case of node-based reviews, the UID was always being passed in, since the UID is not the current user, but the UID of the node author. This patch should fix the problem, and I've already committed it.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.