Closed (won't fix)
Project:
Voting API
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2007 at 01:28 UTC
Updated:
24 Jun 2009 at 14:44 UTC
Using this API function:-
$vote_data = votingapi_get_voting_results('node', $node_id);
echo $vote_data[0]->value; // average
echo $vote_data[1]->value; // count
These TWO arrays (keyed, '0' and '1'), switch back and forth indeterminably?!
I think it's a bug, or some kinda issue...
Comments
Comment #1
eaton commentedThere's no assurance that the results will come in with a particular order. votingapi_get_results() just tosses back an array of 'vote result records'; there may be multiple averages based on tag, or multiple counts based on tag, in addition to the main one. So it just puts them in an array and allows authors to pick the one they need. It's less than ideal but there are provisions for better filtering in the 6.x branch.