Project:Captcha Riddler
Version:5.x-3.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#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

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?

#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

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

#7

Status:postponed (maintainer needs more info)» needs review

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

AttachmentSize
riddler.module_0.patch 819 bytes

#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

Status:needs review» needs work

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

Component:Documentation» Code
Status:needs work» needs review

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

AttachmentSize
riddler.module.new_.patch 871 bytes

#16

Status:needs review» fixed

Patched and commited in release 5.x-3.1

#17

Status:fixed» closed (fixed)

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