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

Comments

vm’s picture

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.

soxofaan’s picture

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 .

robloach’s picture

Version: 5.x-2.0 » 5.x-3.x-dev
Status: Active » Postponed (maintainer needs more info)

Do you still receive this error in Captcha 3.x?

skizzo’s picture

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?

soxofaan’s picture

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

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']"

robloach’s picture

Title: Doens't work » Update Captcha Riddler's API
Project: CAPTCHA » CAPTCHA Riddler
Version: 5.x-3.x-dev » 5.x-3.0
Component: Captcha API (captcha) » Documentation

Moved to Captcha Riddler.....

robloach’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new819 bytes

..... and here's the patch of soxofaan's fixes.

skizzo’s picture

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.

soxofaan’s picture

another mismatch in function riddler_captcha():
"case 'process' :" should be "case 'preprocess':"

skizzo’s picture

Tested it.
It works smoothly now.
Thank you.

Artem’s picture

Status: Needs review » Needs work

Since the attached patch is incomplete, I guess the status has to be changed to "code needs work".

Artem’s picture

I manually performed changes proposed by soxofaan. Looks like working. You can see it here

Dieter_be’s picture

Applied saxofaans patch and did the other modification too.
Seems to work :-)
Thanks!

demon326’s picture

mm i'm still having the same prob after fixing the probs above....

JohnForsythe’s picture

Component: Documentation » Code
Status: Needs work » Needs review
StatusFileSize
new871 bytes

Here's a combined patch with the above fixes. It works for me.

imerlin’s picture

Status: Needs review » Fixed

Patched and commited in release 5.x-3.1

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.