Hello... I'm having a problem with anonymous users using fivestar when normal or aggressive caching is enabled. Everything seems to work fine when caching is disabled. I'm using drupal 6.14.
1. An anonymous user views a node that has no votes, and clicks on 5 stars. It says their vote has been saved.
2. If the anonymous user reloads the page, it still says "no votes yet".
3. If I log in as an admin, I can see the one vote, but if I log out and reload the node, it still says "no votes yet".
Did I forget to enable a permission somewhere to allow anonymous users to see other anonymous users' votes?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#3 | fivestar.module-592746-3_D6.patch | 1.11 KB | Darren Oh |
Comments
Comment #1
quicksketchThis actually isn't a bug in that Fivestar has *never* supported showing anonymous votes or expiring the page cache. The "temporary" nature of the vote is intended to provide immediate feedback, but the actual page display won't be updated until the set amount of time passes as configured in the page cache settings (admin/settings/performance).
If Fivestar were actually to expire the page cache, a site with a lot of ratings would constantly be expiring the cache. Some sites (such as usmagazine.com) receive hundreds of comments *a minute*. Even though they're not running Fivestar, it's not hard to imagine a similar situation.
This isn't an unsolvable problem though, we could give anonymous users a cookie to store their ratings on various pieces of content, making it look like their votes stick until the page cache expires and they get a new page anyway. It would also be helpful in showing the user their own rating if you're using a display other than the "Average" display.
So I'll move this to a feature request because this has never formally been requested. However this feature will not be added in the 1.x version (or Drupal 5) since all new functionality is being added to the Drupal 6/7 targeted Fivestar 2.x.
Comment #2
ryansc CreditAttribution: ryansc commentedThank you very much. I totally understand and appreciate you considering this as a feature request.
Comment #3
Darren OhIn that case, "Your rating" should not be shown to anonymous users.
Comment #4
Mindy CreditAttribution: Mindy commentedThis is a major drawback to an otherwise fantastic module. I'm really looking forward to seeing this feature request added somehow. Nifty idea for a workaround, quicksketch!
Comment #5
quicksketchI'm no longer actively maintaining Fivestar (ezra-g is now maintainer), but I should note that Flag module has the exact functionality I described in #1, using cookies to maintain a list of all content that uses have flagged as an anonymous user.
Comment #6
hanoiisubscribe
Comment #7
angelmax CreditAttribution: angelmax commentedsubscribe
Comment #8
zeagon CreditAttribution: zeagon commentedHas anyone found a fix for this yet? or better posted it public soomewhere?
Comment #9
apes132 CreditAttribution: apes132 commentedsubscribe
Comment #10
chuckbar77 CreditAttribution: chuckbar77 commentedsubscribing
Comment #11
geerlingguy CreditAttribution: geerlingguy commentedSubscribe. Also, for those using views to display voting widgets: #592312: Views for Anonymous Users not joined correctly.
Comment #12
ericduran CreditAttribution: ericduran commentedMoving the 2.x, there won't be any more development in the 1.x branch.
Also I'm curious is this is an actual bug. Can some elaborate why this is file as a bug report?
Thanks.
Comment #13
asb CreditAttribution: asb commentedI think it's a feature request. But a really important one ;)
Comment #14
Darren OhIt was filed as a bug report because, in addition to the missing feature, there is a bug: users are told they have no votes after they have voted. I think it’s important that we disclose this bug to potential users.
Comment #15
ericduran CreditAttribution: ericduran commentedThis is a feature request. This was done on purpose hence why its not a bug.
Whats the recommended solution? Use cookies for anonymous user to see if they've voted?
That would work fine, but just be aware that we're still not going to be able to tell if the user voted or not if the cookie is no longer present.
Comment #16
Darren OhThere are two problems:
1. Anonymous users cannot see their votes = feature request
2. Page shows "Your rating" to anonymous users even though it is not actually available = bug report
I seriously doubt that anyone intended to show anonymous users a "Your rating" widget that tells them they have not voted, no matter how many times they try. It’s more likely that this feature wasn’t tested with caching enabled. But I won’t change the status of this issue.
Comment #17
asb CreditAttribution: asb commentedIn this case, it might make sense to split this issue (#592746) from October 1, 2009, into two distinct threads: One for the feature request (might remain #592746), and one for the bug report (might become a new issue).
There ist also something else which might be connected to the mentioned issues: At least on my sites, anonymous users don't get a Fivestar widget, but a dropdown; logged-in users see the widget (Fivestar widget embedded in a View; maybe related to #592312: Views for Anonymous Users not joined correctly, or maybe a freak incident on my sites).
However, this issue (#592746) has been filed against 6.x-2.x-dev, while most users might be still at 6.x-1.19 tar.gz from 2009-Oct-22; this last stable/recommended release is almost two years old, and the code might have significantly changed from 1.19 to 2.x-dev. I believe it's a real problem if the actual code used in production and the development code is forking too much.
Comment #18
nguyentran CreditAttribution: nguyentran commentedHello, in Drupal 7 fix this by go to
Home » Administration » Configuration » Development>> Performance --- Uncheck the "Cache pages for anonymous users "
And if you have problem with "A anon user can votes many times.... " so you can go to link to fix it http://drupal.org/node/997092#comment-3940040
Comment #19
Darren OhWe already know this works when caching is turned off. We’re just waiting for someone to review the patch that stops anonymous users from being told they have not voted when caching is on.
Comment #20
Darren OhComment #21
nguyentran CreditAttribution: nguyentran commentedHello
I see in fivestar.module the position in fivestar_get_votes() function
// If the user is anonymous, we never bother loading their existing votes.
// Not only would it be hit-or-miss, it would break page caching. Safer to always
// show the 'fresh' version to anon users.
I decide to break the page caching, is it good for site. I think if i break the caching, maybe it will work.
Ideas will be appreciated.
Comment #22
Darren OhIf you break caching, your site will likely crash whenever it gets a large amount of traffic. Better to stop showing the “no votes yet” message to anonymous users.
Comment #23
nguyentran CreditAttribution: nguyentran commentedHi Darren Oh
It's simple to modify the theme not to show the 'no votes yet', but i still don't understand why it crash, i just add soome code after the previous comment to load the new value that the anonymous has voted.
Follow my code
That would be great if i can understand more about Drupal
Comment #24
nguyentran CreditAttribution: nguyentran commentedHello,
After a long time to find out the solution for this, imho i will clear or disable cache of current page when anonymous visit the page. i have two ways to do this
1 :
2:
You can put this code row where loading the field.
Any ideas for my solution, please comment. Thank you so much !
Comment #25
Darren OhYou should try it and see what happens when your site receives high traffic. It is not a suitable solution for serious sites.
Comment #26
ken_y CreditAttribution: ken_y commentedI concur with Mr. Oh. Breaking the cache will most probably fail with high traffic.
Why not split out the feature request?
Comment #28
MGParisi CreditAttribution: MGParisi commentedDisable Cache is not the solution. We need to disable cache in a more eloquent way. If turning off cache for anonymous users will lead to a huge increase in performance and will hurt many sites. I will love to use anonymous voting, but not at this cost!
Comment #29
Alan D. CreditAttribution: Alan D. commentedLove a work around to the anonymous users current vote, spent a bit of time trying to debug this till I found out that this was a feature rather than a bug :/
Comment #30
MGParisi CreditAttribution: MGParisi commentedWill a bounty put a fire under someones butt?
Comment #31
Darren OhWe had a patch here that fixed the bug, but instead of reviewing the patch, people argued that it's not a bug. If someone updates the patch I will be happy to review it, but I'm not wasting my time submitting another patch no one reviews.
Comment #32
MGParisi CreditAttribution: MGParisi commentedDarren Oh, I could care less if its a "feature" or a "bug". 5 Stars is dead and rating doesn't work either nor does it have the features I want.
It doesn't work and the patch didn't pass the test:( From what the THREAD said I think the patch took away something and didn't fix it so that the entire 5 star would be updated?
If I am wrong, then please re-roll a patch that passes and I will be the first to test it.
Comment #33
PieterDC#2297231: Fivestar Not Working for Anonymous Users with Cache Enabled is also about Fivestar issues when page caching is enabled.
It holds a couple of suggestions:
Comment #34
dbt102 CreditAttribution: dbt102 commented