Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
- Created a form with the webform module,
- checked "Add CAPTCHA administration links to forms",
- visited a form I created with the Webform module,
- clicked the link "Place a CAPTCHA here for untrusted users."
- clicked "Save".
I recieved a warning "Illegal form_id" on the "CAPTCHA point adminstration" page.
Comments
Comment #1
traxer CreditAttribution: traxer commentedForm ID of the form is "webform_client_form_21". CAPTCHA module validates Form IDs using /^[a-z_]+$/.
Comment #2
traxer CreditAttribution: traxer commentedComment #3
soxofaan CreditAttribution: soxofaan commentedGood catch
fixed in HEAD by http://drupal.org/cvs?commit=108203
This commit also includes the first SimpleTest tests for CAPTCHA module, yay!
(Tests cover the CAPTCHA point administration)
Comment #4
soxofaan CreditAttribution: soxofaan commentedfixed for 6.x-1.x by http://drupal.org/cvs?commit=108204
(issue not applicable to 5.x-3.x, but it is applicable to issue/patch http://drupal.org/node/214557#comment-777792)
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedIs there any chance of this fix being backported to 5.x? I'm experiencing the same problem in 5.x-3.2.
Comment #7
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedScratch that. User error!
Comment #8
webengr CreditAttribution: webengr commentedI am using drupal 6.12
with webform 6.x-2.6 2009-Feb-16
with captcha
captcha-6.x-2.0-beta5.tar.gz
oops using beta..
and I looked and the form id generated by webform module is "webform-client-form-7"
note it is using hyphens, -, and not underscores, _
I get the illegal notice with that form ID.
I was able to enter it into the captcha page with underscores, without the illegal notice,
but it is using hyphens so that does not help.
I Just updated to the dev capatcha from May 18 - it also fails, Illegal form_id
Comment #9
webengr CreditAttribution: webengr commentedhmmm,
in the file captcha/captcha.admin.inc
I added a hypen after the pregmatch for a-z0-9_
Will see what it does...
Comment #10
webengr CreditAttribution: webengr commentedAlright, crazy webrower inspect element showed id with hyphens...
getting confused, after updates the form id is showing with undescores not hyphens...
so disregard.
apologies.
Comment #11
soxofaan CreditAttribution: soxofaan commented@webengr: The internal form id in Drupal is always with underscores,
when rendered in HTML, the underscores are replaced with hyphens in some places like in the <form ...> element, but there should also be an hidden element like
<input type="hidden" name="form_id" id="edit-comment-form" value="comment_form" />
which shows the real form id (comment_form in this case)
Comment #12
dyland CreditAttribution: dyland commentedIt was rejecting my form id due to camel casing - I fixed by adding ignore case to preg_match i.e.
if (!preg_match('/^[a-z0-9_-]*$/i', $form_id)) {
Comment #13
soxofaan CreditAttribution: soxofaan commentedHow do you get a camel cased form_id? A standard Drupal form_id is [a-z0-9_] only. Is it a custom module?
Comment #14
Ian Burge CreditAttribution: Ian Burge commentedDrupal forms use underscores, replace the hyphens with underscores and it should work.
Comment #15
yuganathan2020 CreditAttribution: yuganathan2020 as a volunteer and commentedI have faced same illegal error i have fixed using the form id webform_client_form_ using underscore if we use hypen its through the error.