Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Relevant code snippet from captcha_validate() function:
$captcha_info = $form_state['captcha_info'];
// 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'];
$solution = db_result(db_query('SELECT solution FROM {captcha_sessions} WHERE csid = %d', $csid));
I have a following scenario:
1. drupal form with image captcha.
2. There is a page that displays the form
3. form submitted using ajax request and form validate and submit callbacks always call exit()
4. attempts to submit such a form result in invalid captcha message form the very first attempt
5. debugging the problem leads me to think that captcha management in general is inconsistent.
Comments
Comment #1
soxofaan CreditAttribution: soxofaan commentedThe current implementation of CAPTCHA is known to be incompatible with AJAX/AHAH workflows
related issues:
#918856: CAPTCHA Session Reuse message on webforms
#180328: AHAH/AJAX request for new challenge
#334377: Patch to Allow AJAX Support
Maybe, it's a good idea to start the general discussion here in this thread.
The problem is that I have very limited time to work on this module and working with AJAX in Drupal 6, especially to get CAPTCHA working, is hairy to say at least
If you have any input on how to tackle this, please elaborate.
Comment #2
wundo CreditAttribution: wundo commented