i'm trying to insert a fair few random anonymous votes programmatically calling this function directly.

the check
$uid = empty($uid) ? $user->uid : $uid;

is always TRUE and will always be set to the $user->uid when i pass in 0 for the uid. therefore only one vote will be counted (grr!)

so: here's a little patch to use is_null instead for the two checks.

CommentFileSizeAuthor
check.patch577 bytesGeorge2

Comments

George2’s picture

Status: Active » Needs review
quicksketch’s picture

Status: Needs review » Needs work

I agree this is a bit of a problem, but this change won't have the effect you desire. Because Fivestar also checks based on IP address, you'll still only be able to register one vote as an anonymous user. Worse yet, this function is called all over the place, and since it doesn't have an $ip_address parameter, we'll need to update all the calls to this function.

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. However, if a volunteer can be found who is willing to test patches for the Drupal 6 version, we could revert it to normal maintenance. See Help testing Drupal 6 patches.