Closed (fixed)
Project:
Fivestar
Version:
5.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2007 at 19:38 UTC
Updated:
19 Dec 2007 at 17:42 UTC
I added a fivestar field to a CCK content type. The Fivestar rating displays the actual rating when I go to an individual node but in a table view for that CCK type it always shows 5 stars rather than the actual rating.
Comments
Comment #1
quicksketchI can't reproduce, could you provide a sample URL or provide more information about your configuration? A list of the exact steps you used to create your type and view (maybe just an export of the view) would be helpful. Thanks!
Comment #2
henrrrik commentedfivestar_value_display_handler use the fivestar_stars_? setting when it calls theme_fivestar_static, so it always defaults to 5 stars.
I made a few changes to the function that fixes the problem. Is this a "proper" way to grab the node type in this context? I'm new to Drupal.
Comment #3
henrrrik commentedWhat I meant to say was that fivestar_value_display_handler DOESN'T use the fivestar_stars_* settings...
Comment #4
quicksketchThanks henrrrik, I see the problem now with your explanation.
I'm a little nervous about a SQL query per row, just for the number of stars. I'm suggesting this change (http://drupal.org/node/167781) to VotingAPI's views integration which would allow you to enter into the 'option' field the number of stars you wish to display. If the option is not set, we could fall back on doing the SQL queries as you suggest. What do you think?
Comment #5
henrrrik commentedThat sounds reasonable.
Comment #6
quicksketchI committed this fix a while ago but didn't wire up the necessary line to actually display the new stars! Here's the code I settled on:
So it will look first for an option (the VotingAPI patch finally got the green light I believe), then if you've included the node_type field it will use that if available. Finally, if nothing else it'll make the SQL query per row as a last-ditch effort to find the node type. Thanks for your help henrrrik on this and sorry it took so long. It'll be in the 1.9 release, which is growing closer every day.
Comment #7
henrrrik commentedExcellent. Thanks!
Comment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.