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.

Comments

eaton’s picture

Status: Active » Fixed

Fixed in the latest dev release. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.