configuration Drupal 7.7, FiveStar 2.x-dev, References module, Unique field.
- I have node value of Story tale
- Every user can write an Review and rate each story tale with multiaxis fivestar like: Idea, Grammar, etc. configures as rating references.
- Every user can create only one review per each story tale (unique field module).
- Rating is available when User create a Review node (so not ajax).
I can attach average rate of each one from multiaxis like Average Grammar, Average Idea etc for story tale by views.
What I can't do is: how to compute average of all multiaxis values it menas create one number computed from rating of Grammar + Ideas.
I tried create a Fivestar field for overall (average value). Then I created Computed field which compute overall value of review.
$overall = ($entity->field_style[$entity->language]['rating'] + $entity->field_rate[$entity->language]['rating'])/2; $entity_field['value'] = $overall/10; $entity->field_overall[$entity->language]['rating'] = $overall;
Well Problem is that In field_overall is stored requested value, but VotingApi don't register this change created by computed field and it count 0 as stored value.
1. Problem is that fivestar store this value before computed field compute overall rating
2. Or problem is, that fivestar is reading value not from
$entity->field_overall but from other value.