Closed (fixed)
Project:
CAPTCHA
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Mar 2008 at 11:11 UTC
Updated:
8 Aug 2015 at 10:15 UTC
Jump to comment: Most recent
I recieved a warning "Illegal form_id" on the "CAPTCHA point adminstration" page.
Comments
Comment #1
traxer commentedForm ID of the form is "webform_client_form_21". CAPTCHA module validates Form IDs using /^[a-z_]+$/.
Comment #2
traxer commentedComment #3
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 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) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
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 commentedScratch that. User error!
Comment #8
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 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 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 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 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 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 commentedDrupal forms use underscores, replace the hyphens with underscores and it should work.
Comment #15
yuganathan2020 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.