Issue #1024370: Make sure we can use a top level form value $form_state['values'...
authorrocnhorse
Wed, 2 Nov 2011 22:24:49 +0000 (23:24 +0100)
committerStefaan Lippens
Wed, 2 Nov 2011 22:32:25 +0000 (23:32 +0100)
captcha.module

index d9e4902..7144cd2 100644 (file)
@@ -286,6 +286,10 @@ function captcha_element_process($element, &$form_state, $complete_form) {
 
     // Store the solution in the #captcha_info array.
     $element['#captcha_info']['solution'] = $captcha['solution'];
+
+    // Make sure we can use a top level form value $form_state['values']['captcha_response'], even if the form has #tree=true.
+    $element['#tree'] = FALSE;
+
   }
 
   return $element;