Value for name field in variable table is too long
wmostrey - April 2, 2007 - 11:33
| Project: | CAPTCHA |
| Version: | 5.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I'm not sure there is anything you can do about this, but just to let you know that the way currently those values are created, they can become too long quite quickly. The field is set to varchar(48) and the captcha module tries to insert "job_application_node_form_authenticated_user_cap" as a value. With cck and role names this can become larger than 48 characters easily.

#1
Just a correction: the name field is too short, set to 48 chars.
#2
i used a patch like this fromt that issue:
http://drupal.org/node/105525
for drupal 5 i altered this patch slightly:
foreach(node_get_types() as $k => $t) {$captcha_points[$t->type . "_node_form"] = t('Create a ' . $t->name . ' node');
}
#3
A simple install function as below, would do the trick.
<?phpfunction captcha_install() {
db_query("ALTER TABLE {variable} CHANGE name name varchar(255) NOT NULL default ''");
}
?>
#4
I was pointing at the node information how it is now stored in an object not an array...
Also, i dont know if varchar(255) is correct. I'd rather think 128 should be entered because this is the new variable length in HEAD.
Changing the table ONLY does not solve the problem for me, it's the modified patch above.
#5
Is this still a problem?
#6
No,
The rewrite of 5.x-3.x does not "misuse" the variables table anymore like in 5.x-2.x and before, since it uses its own captcha_points table
duplicate: http://drupal.org/node/145515 (one of my first bug reports for CAPTCHA, which triggered me to rewrite the CAPTCHA module)
#7