Update Captcha Riddler's API
mcduarte2000 - September 1, 2007 - 19:23
| Project: | Captcha Riddler |
| Version: | 5.x-3.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
Whatever I write, I always have the same error message:
* Invalid captcha token.
* The answer you entered for the captcha challenge was not correct.
I uninstalled and installed it again, and it never works... Something is broken, but I've no idea what...

#1
because it is indeed working for many others, I suggest stating what version of token.module is being used. as well as
version of PHP ?
version of Apache ?
Try and give the developers something to go on, as your problem may be System specific.
#2
the error message "invalid captcha token" is typically because of a CAPTCHA API mismatch
Upgrade to CAPTCHA module v5.x-3.0-rc2 or later.
versions before 5.x-3.0-rc2 are known to be buggy/unusable
Also please state the precise version of the CAPTCHA base module and external CAPTCHA challenges (e.g. CAPTCHA pack, reCAPTCHA, etc). You specified version 5.x-2.0 for the CAPTCHA base module, is that right? That version is not available anymore from http://drupal.org/project/captcha .
#3
Do you still receive this error in Captcha 3.x?
#4
I am getting the "Invalid captcha token" error with
PHP 5.1.6 Apache/2
Captcha 5.x-3.0-rc3
Captcha Riddler 5.x-3.0
Token 5.x-1.8
- it works fine fin Math Question...
- is the Token module a requirement?
#5
"invalid captcha token" has nothing to do with the token module (CAPTCHA does not require token module), so that's not the problem.
The problem is that CAPTCHA riddler uses the old CAPTCHA API. this is a bug in CAPTCHA Riddler
at first sight (I didn't test this) in riddler.module:
<?php
function riddler_form () {
$form['preprocess'] = TRUE;
$form['value'] = (string)(strtolower(variable_get("riddler_answer", "yes")));
$form['form']['captcha_answer'] = array(
'#type' => 'textfield',
'#title' => variable_get("riddler_question", "Do you hate spam? (yes or no)"),
'#required' => TRUE,
'#description' => t('Security question, designed to stop automated spam bots'),
'#weight' => variable_get('riddler_weight', 0),
);
return $form;
}
?>
"$form['value']" should be "$form['solution']"
"$form['form']['captcha_answer']" should be "$form['form']['captcha_response']"
#6
Moved to Captcha Riddler.....
#7
..... and here's the patch of soxofaan's fixes.
#8
tried it, indeed it fixes the "Invalid captcha token" error,
although now I get the "The answer you entered for the
captcha challenge was not correct" error, even if I enter
the correct answer. Should I open a Captcha Riddler issue?
Thank you.
#9
another mismatch in function riddler_captcha():
"case 'process' :" should be "case 'preprocess':"
#10
Tested it.
It works smoothly now.
Thank you.
#11
Since the attached patch is incomplete, I guess the status has to be changed to "code needs work".
#12
I manually performed changes proposed by soxofaan. Looks like working. You can see it here
#13
Applied saxofaans patch and did the other modification too.
Seems to work :-)
Thanks!
#14
mm i'm still having the same prob after fixing the probs above....
#15
Here's a combined patch with the above fixes. It works for me.
#16
Patched and commited in release 5.x-3.1
#17
Automatically closed -- issue fixed for two weeks with no activity.