Hi, I have a setup in which i have two fivestar fields for a product.
The first is an edit only field for Editor Ratings,
The second is a view update field for Surfer Ratings.

The main issue occurs when you try to add a surfer rating.
1st the rating does not apply, and once the ajax has finished there's still no votes.
2nd this removes the values set for the editors rating.

Does any one have an idea on where the problem is and how to fix this?

Comments

acetolyne’s picture

I have written a tuorial on adding dynamic fivestar ratings to your content, If you use this technique and then make one of them editable only by "editor" role then you should be able to achieve what you want. my tutorial is located over at

http://www.acetolyne.net/Projects/node/44

Not sure where the problem is with your setup but I hope this helps you achieve your goal.

Darc_Nite’s picture

@acetolyne thanks for your help, but i'm not quite sure this is the best solution for our site

The issue with this is that for each product we want an Editors rating and a Surfers rating, thus for every product there would be two vote type nodes, and when you have well over 300 products the overhead would be too much...

The other thing is that this seems to have only started to be a problem recently, with any selection on the surfers rating, killing off the current ratings.

So this could be a bug report, but i'm not sure, as we also have recently moved servers.

ericduran’s picture

I would guess the issue is you're not using a different voting axis for the two different fields.

You can edit the field and change the axis to something like 'external_vote' and 'internal_vote for the field that the editors are going to be editing.

The way fivestar works is that any number of fields can be created but the vote is targeted against what ever 'axis' is selected. So you can have 10 fields that all do the same thing, or you could have 10 fields that each count against a different axis.

Does this helps. If you're still having problems let me know. I'll be glad to help you figure this out :)

francisperea’s picture

Hi all, just the same problem here.

I've two FiveStars fields, one for editors rated while editing using one axis and another for registered users rated while viewing using another axis.

Whenever a registered user rates his field, the value of the other field get erased.

Any idea?

magicRoot’s picture

Any resolution to this issue? I am experiencing the same, it seems to be an ajax issue where the return data is injected to one of the many widgets while the others are blanked out. Also, on my end, this happens to the fields which have no votes yet. My guess is that its due to the element target being manipulated after the form submission; i.e., the element target is a class that actually manipulates more than one element in the DOM as opposed to the specific element that it should update.

heine’s picture

Category: support » bug
Anonymous’s picture

magicRoot, your issue sounds similar to the one I've just reported - https://drupal.org/node/2034509

heine’s picture

Title: Multiple Fivestar removes all values » Voting on one of multiple fivestar fields leads to unexpected results
Anonymous’s picture

Thanks for cleaning this up Heine. It does seem like the other issues may be related.

In my instance I have multiple 'rate while viewing' widgets on a single node, and using one of these widgets changes the value of all rating fields to the selected value.

I assume the problem is in the Ajax coding as all the values are updated immediately, however I'm a bit lost when looking at the code. If anyone could assist it would be great, as this seems like a major bug to me.

Anonymous’s picture

Anyone? I'm willing to financially contribute to a solution (within reason) if that helps.

mesch’s picture

I tried to replicate this by setting up two fivestar fields of widget type "Stars (rated while viewing)" on the same node. Each field has a separate voting tag. With this setup I could not replicate the issue.

In the course of doing this I did note that when a rating is selected for one field, the field value is updated in the field database table, but the "rating" for the other field is reset to NULL.

This is not impacting the display value, I presume because the default value is being fetched using the voting api rather than the stored value. I'm not that familiar with the inner workings of this module so it's unclear whether this behaviour is by design or a bug.

Anonymous’s picture

Thanks for your help with this MEsch. In my situation, the problem turns out I was using the same voting tag for all rating fields, thus they all got updated with the same value. Adding separate voting tags fixed it. D'oh!

I also note that the fields displayed in the object when I did a node_load on that rated node did not seem to return all values (only one). This may reflect the issue mentioned above where other fields are set to NULL. Doing a direct database query to the votingapi_vote table in the database I was able to retrieve the correct values, but this problem should probably be investigated further.

stpaultim’s picture

I think that the problem that Darc_Nite and francisperea were describing is a desire to have two ratings on the same node with two different permissions. The goal is to have:

1) One rating field that only the site editor can vote in
2) One rating field that any user can vote in

I don't think that fivestar gives you the ability set different permissions for different fields. The workaround seems to be, to make the editor field "Stars (rated while editing)" - if the editor is the only one with able to edit page, then they are the only one that can vote on that particular field. The other field would be set to "rated while viewing" and allow anyone to vote.

However, if you set it up this way. The editor is able to set their rating during editing. However, when another user votes while viewing, it resets the editor field (deletes the content). I'm assuming that the problem is related to the permissions.

I'm trying to do that same thing and running into the same trouble. I'm using different "tags" for each field, so that is not the problem.

whiteph’s picture

Issue summary: View changes

I think this may be a duplicate of Rating is reset, which is fixed in 7.x-2.x-dev. Can you please check if the latest 7.x-2.0-beta1 version fixes this issue?

whiteph’s picture

Status: Active » Closed (duplicate)