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

wmostrey - April 2, 2007 - 11:37
Title:Value for value field in variable table is too long» Value for name field in variable table is too long

Just a correction: the name field is too short, set to 48 chars.

#2

schnizZzla - April 18, 2007 - 02:38

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

Heine - April 18, 2007 - 05:35

A simple install function as below, would do the trick.

<?php
function captcha_install() {
 
db_query("ALTER TABLE {variable} CHANGE name name varchar(255) NOT NULL default ''");
}
?>

#4

schnizZzla - April 18, 2007 - 14:32

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

Rob Loach - September 5, 2007 - 08:41
Version:5.x-1.x-dev» 5.x-3.x-dev
Status:active» postponed (maintainer needs more info)

Is this still a problem?

#6

soxofaan - September 5, 2007 - 09:11
Status:postponed (maintainer needs more info)» fixed

Is this still a problem?

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

Anonymous - September 19, 2007 - 11:12
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.