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

VeryMisunderstood - September 1, 2007 - 19:27

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

soxofaan - September 1, 2007 - 21:46

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

Rob Loach - September 5, 2007 - 08:05
Version:5.x-2.0» 5.x-3.x-dev
Status:active» active (needs more info)

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

#4

skizzo - September 18, 2007 - 14:03

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

soxofaan - September 18, 2007 - 14:17

"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

Rob Loach - September 18, 2007 - 14:20
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

Rob Loach - September 18, 2007 - 14:25
Status:active (needs more info)» patch (code needs review)

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

AttachmentSize
riddler.module_0.patch819 bytes

#8

skizzo - September 18, 2007 - 15:51

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

soxofaan - September 18, 2007 - 16:04

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

#10

skizzo - September 19, 2007 - 07:38

Tested it.
It works smoothly now.
Thank you.

#11

Artem - September 20, 2007 - 18:28
Status:patch (code needs review)» patch (code needs work)

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

#12

Artem - October 6, 2007 - 09:59

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

#13

Dieter_be - November 11, 2007 - 18:20

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

#14

demon326 - December 11, 2007 - 20:01

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

#15

JohnForsythe - March 1, 2008 - 02:07
Component:Documentation» Code
Status:patch (code needs work)» patch (code needs review)

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

AttachmentSize
riddler.module.new_.patch871 bytes

#16

imerlin - March 28, 2008 - 11:51
Status:patch (code needs review)» fixed

Patched and commited in release 5.x-3.1

#17

Anonymous (not verified) - April 11, 2008 - 11:51
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.