I, too, am having many of the same problems mentioned in these posts, but I can't find any other references to this problem.
When clicking the Save Configuration button on the Captcha Site Configuration page I get the error listed below, only this error is listed in plain text. I need to go back one page (with the browser back button) and then I get a "The configuration options have been saved" message at the top of the page.
I am using a current CVS snapshot of Captcha although this problem has persisted through several patches, hacks and updates that I tried before posting this error here. I am using Drupal 5.0. I am considering tying to upgrade Drupal to the most current version as well.
In addition to the problem posted here, I also can't get textimage to see my fonts folder. And when testing Captcha, it gives an error message that "The image verification code you entered is incorrect." first loading the contacts page. I will probably just change the text to something like, "be sure to enter the correct verification code below" if we can't fix the behavior.
I have also already tried the session.inc hacks about locking and unlocking the sessions. http://drupal.org/node/80615
All other suggestions will be apreciated, Thanks
Warning: Table 'system' was not locked with LOCK TABLES query: SELECT * FROM system WHERE type = 'theme' in /mypath/includes/database.mysql.inc on line 167
Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '<em>Duplicate entry &#039;user_login_block_Anonymous/_Authenticated_captch&#039; for key 1\nquery: INSERT INTO variable (name, value) VALUES (&#039;user_login_block_Anonymous/_Authenticated_captcha&#039;, &#039;i:0;&#039;)</em> in <em>/mypath/includes/database.mysql.inc</em> on line <em>167</em>.', 2, '', 'http://mydomain/admin/settings/captcha', 'http://mydomain/admin/settings/captcha', 'myipaddress', 1171968354) in /mydomain/includes/database.mysql.inc on line 167
Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '<em>Duplicate entry &#039;contact_mail_user_Anonymous/_Authenticated_captc&#039; for key 1\nquery: INSERT INTO variable (name, value) VALUES (&#039;contact_mail_user_Anonymous/_Authenticated_captcha&#039;, &#039;i:0;&#039;)</em> in <em>/mypath/includes/database.mysql.inc</em> on line <em>167</em>.', 2, '', 'http://mydomain/admin/settings/captcha', 'http://mydomain/admin/settings/captcha', 'myipadress', 1171968354) in /mypath/includes/database.mysql.inc on line 167
Warning: Table 'watchdog' was not locked with LOCK TABLES query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '<em>Duplicate entry &#039;contact_mail_page_Anonymous/_Authenticated_captc&#039; for key 1\nquery: INSERT INTO variable (name, value) VALUES (&#039;contact_mail_page_Anonymous/_Authenticated_captcha&#039;, &#039;i:0;&#039;)</em> in <em>/mypath/includes/database.mysql.inc</em> on line <em>167</em>.', 2, '', 'http://mydomain/admin/settings/captcha', 'http://mydomain/admin/settings/captcha', 'myipaddress', 1171968354) in /mypath/includes/database.mysql.inc on line 167
Comments
Comment #1
scor commentedI have the same problem. I found out it's due to the way captcha module handles its variable in the variable table.
The lenght of the name of a variable is fixed to 48 char by design: the field in the db is a varchar(48).
The captcha module stores for each combinaison of form and user role a value in the variable table, but when the user role is too long, then the combined name can exceed 48 char.
Here is an example. Given Lowell's post, I assume he has a role named 'Anonymous/_Authenticated'.
The names stored as variable are composed this way:
formName_roleName_captchaExamples of fromName are user_login_block, contact_mail_page etc...
If we put everything together, we read
user_login_block_Anonymous/_Authenticated_captchathis is 49 char, and only 48 will be stored in the db: user_login_block_Anonymous/_Authenticated_captch
The second time you try to update this variable, an error will be fired by mysql because the broken variable already exists.
To fix this, 2 options:
- change the name of the roles that are too long
- increase the lenght of the name field in the variable table to 128 or 255 char, for instance using a db admin tool like phpMyAdmin
This problem has already been talked about:
http://drupal.org/node/62673
http://drupal.org/node/103634
Comment #2
scor commentedby the way, the fix for the variable name length has been fixed in the drupal core http://drupal.org/node/103634#comment-204575
Comment #3
Lowell commentedthanx for the info
will look into it when I get some time
Comment #4
(not verified) commented