I've enabled star rating on a field in a custom content type, and selected the "10 stars" option. Everything else works fine, except when a user rates something as 10 stars, it is registered as only 1 star (the star rating that shows up on the page displays the exact same thing a one-star rating would show -- one filled-in star and nine gray ones). Help would be very much appreciated.

Comments

Threesa’s picture

I'm having the very same issue!

aacraig’s picture

I have the same problem with a five star widget, though the result is the same no matter which star I vote on. The result is always that I voted one star.

From a brief look in rate_vote_ahah() and printing out watchdog messages, it looks like the option passed on line 673 of rate.module is always the same, regardless of the star that's been clicked on:

rate_save_vote($widget, $content_type, $content_id, $option[0], TRUE)
Stormen1’s picture

I had the same problem, but found out what I did wrong. I had enabled the options, not the percentage for the fivestar widget. So when I voted the 5 star, it gave me a five (5) vote. BUT voting API and the fivestar widget is made for 1-100. And if the node has a rating of 1-20 it displays one star, 21-40 two stars and so on. Therefore I was always told I voted 1 star, because I always voted <20.

How to bypass this problem I have no idea. In views, you maybe could somehow divide the result by 20 to display as a number and not the complete widget. But then the problem comes that you can't use math or php inside the rewrite result. (Views 3.) Any other idea?

basirmukhtar’s picture

I found the solution. actually module is working fine. and stormen1 you are right the problem is same.
So, here is the solution,
when you are adding options you fill value field just give it some value according to the number of your total options like i want to add 10 options so i give value 10 to my first option then for second its 10+(previous value) and same goes for all the others and at the end for 10th value i will fill 100 in value field.

Hope this will help you.
Thanks :)

thaistore’s picture

uhh

mauritsl’s picture

Status: Active » Closed (fixed)

Fivestar work indeed with percentages. Use the value 10 for the first star and 100 for the last.

BenjaminRH’s picture

Yep, that was it, thanks.