Method votingapi_select_single_result_value() is incorrect
telega - May 19, 2008 - 15:55
| Project: | Voting API |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Currently method implementation looks this way:
function votingapi_select_single_result_value($criteria = array()) {
return db_result(_votingapi_query('cache', $criteria, 1));
}As _votingapi_query() method uses "SELECT * FROM {votingapi_". $table ."}" query, the value returned by the votingapi_select_single_result_value() method is NOT value of the result but its id.
Possible implementaion of the method could be:
function votingapi_select_single_result_value($criteria = array()) {
if ($results = votingapi_select_results($criteria)) {
return $results[0]['value'];
}
}And possibly return 0 as default value.

#1
Fixed in the latest dev release. Thanks!
#2
Automatically closed -- issue fixed for two weeks with no activity.