Closed (fixed)
Project:
Voting API
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 May 2006 at 15:27 UTC
Updated:
21 Jun 2006 at 16:30 UTC
I noticed that the value field in the {votingapi_cache} table is of type float, but the value inserted was always an integer!
I tracked it down to the query rewrite using %d instead of %f. If you change to %f, you'll get floats in the db.
Old way:
db_query("INSERT INTO {votingapi_cache} (vote_cache_id, content_type, content_id, value, value_type, tag, function) VALUES (%d, '%s', %d, %d, '%s', '%s', '%s')",
$vobj->vote_cache_id, $vobj->content_type, $vobj->content_id, $vobj->value, $vobj->value_type, $vobj->tag, $vobj->function);
New way:
db_query("INSERT INTO {votingapi_cache} (vote_cache_id, content_type, content_id, value, value_type, tag, function) VALUES (%d, '%s', %d, %f, '%s', '%s', '%s')",
$vobj->vote_cache_id, $vobj->content_type, $vobj->content_id, $vobj->value, $vobj->value_type, $vobj->tag, $vobj->function);
Other than that, it's a great module :)
Comments
Comment #1
eaton commentedThis appears to be fixed in the current CVS version, as well as the 4.7 branch. Can you get a copy of the latest version and see if the issue is still present?
Comment #2
datura-1 commentedI've confirmed that it is indeed fixed in the CVS version. Thanks!
Comment #3
eaton commentedComment #4
(not verified) commented