Fiverstar_static doesn't show average count
thomjjames - May 1, 2009 - 04:34
| Project: | Fivestar |
| Version: | 5.x-1.15 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi,
Just performed the 5.x.1.15 update and the static widget showing the average vote is only showing 5 blank stars regardless of whether any votes have been cast on a node.
If i revert to the 5.x.1.13 version of the fivestar_static function it works fine.
I'll take a closer look over the weekend and if i get a fix i'll post a patch.
Thanks
Tom

#1
Thanks, it looks like this is specific to the Drupal 5 version. I can reproduce it easily there, but D6 is working fine.
#2
I'm experiencing the same problem with Drupal 5 and rely on the static widget with the average vote quite heavily. So if a fix could be found I'd be very grateful.
#3
I've looked at this a bit and I believe the problem lies in how the fivestar_static function is being called from within the fivestar_nodeapi function. fivestar_static used to be defined as fivestar_static($content_type, $content_id, $node_type = NULL). 5.x-1.15 changed the definition to fivestar_static($content_type, $content_id, $tag = 'vote', $node_type = NULL). A call to fivestar_static is made in fivestar_nodeapi and passes NULL to $tag. $tag is thus assigned a legitimate value of NULL and 'vote' doesn't get assigned to it.
A call to votingapi_get_voting_result inside fivestar_static is made and this has changed slightly in 5.x-1.15 as well. Instead of 'vote' being hardcoded inside the call, the variable $tag is now being used. However, $tag contains NULL instead of 'vote' and so votingapi_get_voting_result doesn't return the proper value.
When 'vote' is properly assigned to $tag, then everything seems to work normally.
#4
I am also experiencing this issue. I am also using D5.
#5
I am seeing this as well.
#6
Same problem here, however on D6. After downgrade to version 1.13 it works again, so this bug affects 1.15 as well as 1.14.
#7
The problem is that 1.14 was a security patch and bug fix. So rolling back to 1.13 is not really on option on most sites.
#8
Yes, I agree. I just provided the info to clear out in which version the feature worked. However I am not using the 1.13 version on production.
#9
Subscribing...same problem.
#10
Same problem with D5
#11
This patch corrects this problem, which has been committed to the D5 branch.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.