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
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

Eaton - June 6, 2008 - 00:51
Status:active» fixed

Fixed in the latest dev release. Thanks!

#2

Anonymous (not verified) - June 20, 2008 - 00:51
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.