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.
Adding a captcha, either through captcha admin or using hook_form_alter, to a views exposed filter form
1) loads initially with
* Math question field is required.
* The answer you entered for the CAPTCHA was not correct.
2) after submission incorrectly gives:
The answer you entered for the CAPTCHA was not correct.
reproduced by another user here:
[#comment-4095116]
"It seems an exposed view filter form is automatically submitted (before you get the chance to fill it in) in order to show a default view."
Comments
Comment #1
ransomweaver CreditAttribution: ransomweaver commentedTry that again:
http://drupal.org/node/743056#comment-4095116
Comment #2
andykisaragi CreditAttribution: andykisaragi commentedSame issue here...
Comment #3
konrad1811 CreditAttribution: konrad1811 commentedWhen I added CAPTCHA on exposed view filter using admin link there was a kind of error [wrong form id was taken - from div not from views exposed filter form].
When I addedn correct ID form and assigned proper CAPTCHA [image] there was no error, however CAPTCHA didn't show.
I believe this is ID form confusion.
oh forgot my CAPTCHA version... but maybe here the same?
Comment #4
elachlan CreditAttribution: elachlan commentedIs this still an issue?
Comment #5
genjohnson CreditAttribution: genjohnson commentedI'm running into this issue with the latest version, 7.x-1.1.
Comment #6
genjohnson CreditAttribution: genjohnson commentedComment #7
radj CreditAttribution: radj commentedSame issue here. I tried adding the view exposed form ID into the Captcha settings and disabled captcha for that form but it still shows up.
Comment #8
alfredo.ardito CreditAttribution: alfredo.ardito commentedSame issue. It works fine if I disable "Default challenge on non-listed forms."
Comment #9
michalgreksak CreditAttribution: michalgreksak commentedI have a Webform as a contact form with reCAPTCHA and in the Captcha settings (admin > config > people > captcha) have "Default challenge on non-listed forms." enabled. After that, when I set the view exposed form I get the message "The answer you entered for the CAPTCHA was not correct". That I needed to turn of a Captcha in the view and also has "Default challenge on non-listed forms." enabled for webform to be working.
I found a simple solution:
in the Captcha settings I set a new form_id
*views_exposed_form* and set it to *- No challenge -*
From that moment I have the view exposed form disabled and everything works as I expecting =)
I have Captcha 7.x-1.3
Comment #10
dmkelner CreditAttribution: dmkelner at Sleight-of-Hand Studios LLC commentedThanks @michalgreksak. That's exactly my use case.
Comment #11
florianmuellerCHThis still seems to be an issue - isn't there a way on the reCAPTCHA plugin (or the CAPTCHA plugin) to define that the option "Default challenge on non-listed forms" is only valid for not listed webforms (currently it is not only inserted on webforms but also on view filter forms).
EDIT: We achieved a solution on our project adding a hook to one of our core modules, with the help of stackexchange. Just set the default challenge to "none" and the default captcha to "reCAPTCHA" and add the following hook:
Comment #12
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedVersion change only
Comment #13
ghobadipouya CreditAttribution: ghobadipouya commentedi have an error with recaptcha "Im not robot" in my exposed views drupal...
The answer you entered for the CAPTCHA was not correct.
please help me.....
Comment #14
vivdrupal CreditAttribution: vivdrupal commentedEven with Captcha 7.x-1.7, a Views Exposed form seems to be pre submitted.
Consequently, as in the issue reported ten years back, the page loads with the error "Math question field is required."
Comment #15
AnybodySetting the priority back to normal, as it's more an edge-case here. But I'd still be interested to commit a fix, if someone provides a working solution!