Closed (fixed)
Project:
Voting API
Version:
4.7.x-1.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2007 at 08:22 UTC
Updated:
6 Jun 2008 at 00:31 UTC
Database field too short to handle votes from CCK nodes, varchar(20) is not sufficient enough to deal with CCK node names, my patch my resolve a lot of issues with people complaining about random behaviour of votes not working so well..
--- votingapi.install 2006-06-09 21:38:00.000000000 -0700
+++ votingapi.install-fix 2007-04-19 01:14:10.000000000 -0700
@@ -254,4 +254,10 @@ function votingapi_update_9() {
$ret[] = update_sql("ALTER TABLE {votingapi_cache} ADD COLUMN timestamp int(11) default NULL;");
$ret[] = update_sql("UPDATE {votingapi_cache} SET timestamp = " . time() . " WHERE timestamp IS NULL;");
return $ret;
-}
\ No newline at end of file
+}
+
+function votingapi_update_10() {
+ $ret = array();
+ $ret[] = update_sql("ALTER TABLE {votingapi_vote} CHANGE `content_type` `content_type` VARCHAR( 50 )");
+ return $ret;
+}
you'll need to run update.php
| Comment | File | Size | Author |
|---|---|---|---|
| votingapi-install.patch | 609 bytes | dgtlmoon |
Comments
Comment #1
dgtlmoon commentedThere are additional fields that need extending
Comment #2
eaton commentedThe 'content_type' field, while perhaps confusingly named, should store the Drupal object type being voted on. 'node', 'user', etc. Not the node type itself.
Comment #3
dgtlmoon commentedheya eaton
CCK types can be fairly long strings, so i think this issue is still open, node types defined by CCK can be greater than 20chars
Comment #4
eaton commentedYou misunderstand: that field should store the word "node", NOT the type of the node. VotingAPI's 'content_type' field is used to store the kind of high-level content object being voted on. The length of the node type's name doesn't matter, because that should never be stored in the VotingAPI field.