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

quicksketch - May 1, 2009 - 06:57

Thanks, it looks like this is specific to the Drupal 5 version. I can reproduce it easily there, but D6 is working fine.

#2

jkocsis - May 2, 2009 - 04:37

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

jkocsis - May 3, 2009 - 04:50

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

hydrian - May 13, 2009 - 14:14

I am also experiencing this issue. I am also using D5.

#5

dmuth - May 17, 2009 - 23:19

I am seeing this as well.

#6

divamys - May 25, 2009 - 12:13

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

hydrian - May 28, 2009 - 01:50

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

divamys - June 1, 2009 - 10:33

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

Poieo - June 11, 2009 - 15:03

Subscribing...same problem.

#10

c-c-m - June 14, 2009 - 23:10

Same problem with D5

#11

quicksketch - June 30, 2009 - 23:28
Status:active» fixed

This patch corrects this problem, which has been committed to the D5 branch.

AttachmentSize
fivestar_static_display_5.patch 796 bytes

#12

System Message - July 14, 2009 - 23:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.