Download & Extend

notice: Undefined index: captcha_response in captcha.module on line 306.

Project:reCAPTCHA
Version:6.x-1.x-dev
Component:reCAPTCHA Captcha
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

When you submit a CAPTCHA, you get a warning:

notice: Undefined index: captcha_response in captcha.module on line 306.

reCAPTCHA works, it just reports a warning.... Something to do with #preprocess maybe.

Comments

#1

Does anyone else experience this?

#2

I have this same problem after submitting. Using Drupal 6 DEV Sept 17. I have been finding that many of these error are related to cache, but I have no idea how to fix them. I have the same problem in cck when saving old nodes and had the problem when converting old views. The views 2 module had a clear cache button that fix everything in views but the site clear cache did nothing. Must be a mysql issue.

#3

I also ran across this problem. Following the code into recaptcha's preprocess case shows that neither the type nor the response gets used (recaptcha gets the reponse out of $_POST). Thus, here is a quick patch to remove the notice without (hopefully) breaking anything else. Its not a permanent fix.

Index: captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v
retrieving revision 1.58.2.9
diff -r1.58.2.9 captcha.module
333c333
<   $captcha_response = $form_state['values']['captcha_response'];
---
>   // Quickfix for notices being thrown
334a335,340
>   if ($captcha_info['module'] == 'recaptcha') {
>     $captcha_response = '';
>   }
>   else {
>     $captcha_response = $form_state['values']['captcha_response'];
>   }

To fix more permanently, whatever is setting the form values (recaptcha?) should set catpcha_response before passing it to the captcha api.

#4

See #312611: notice: Undefined index: captcha_response in captcha.module issue queue.