Closed (fixed)
Project:
CAPTCHA
Version:
7.x-1.0-alpha3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2011 at 14:49 UTC
Updated:
14 Nov 2011 at 11:46 UTC
In Drupal 7 this simple Form-Element doesn't work properly: http://drupal.org/node/743056
$form['my_captcha_element'] = array(
'#type' => 'captcha',
'#captcha_type' => 'captcha/Math',
);
The entered result will not validate.
Why? function captcha_validate() looks for some values in $form_state (look below) but all available Infos are in $form_state['values']['my_captcha_element'].
So no validation can made.
function captcha_validate($element, &$form_state) {
$captcha_info = $form_state['captcha_info'];
$form_id = $captcha_info['form_id'];
// Get CAPTCHA response.
$captcha_response = $form_state['values']['captcha_response'];
// Get CAPTCHA session from CAPTCHA info
// TODO: is this correct in all cases: see comment and code in previous revisions?
$csid = $captcha_info['captcha_sid'];
...
Is there any callback I have to place ?
Greetings from Hamburg
Comments
Comment #1
soxofaan commentedCan you try it with the latest nighly build?
it contains this commit:
http://drupalcode.org/project/captcha.git/commitdiff/538446c3dcf0abdf060...
which should fix your issue, I hope
(also see http://drupal.org/node/1024370#comment-4876146)
Comment #2
kle commentedsoxofaan - I like to kiss your feet...
This works like a glance for me !
Comment #3
soxofaan commentedno problem